Download MetaTrader 5

Angle of object bitmap

To add comments, please log in or register
Sell products right in MetaTrader. Millions of traders are waiting for this!
Benjamin Nicola
1381
Benjamin Nicola 2016.01.23 18:45 

Hello everybody,

 

I was wondering if it's possible to change the angle of a bitmap image.

I used the center as the anchor point  of the image: ObjectSet("Image",OBJPROP_ANCHOR,ANCHOR_CENTER);

That seems to work, but when I try to change the angle, nothing happens.

I move the image along a MA line, I use a buffer for that and place the image on the MA's coordinates and let it move along the bars.

Now I would like to change the angle of the image so that it points towards the next bar's MA coordinates.

But I don't see anything about changing the angle of OBJ_BITMAP or OBJ_BITMAP_LABEL.

So if somebody knows if this is possible, please let me know.

 

Thanks! 

Stuart Browne
5813
Stuart Browne 2016.01.24 00:55  
I'm not 100% sure on this but I don't recall ever seeing a bitmap angle setting.

The other option of course would be to create multiple bitmap images at the different angles and swap in the one that matches the angle you want when you need it.
Benjamin Nicola
1381
Benjamin Nicola 2016.01.24 14:47  
Stuart Browne:
I'm not 100% sure on this but I don't recall ever seeing a bitmap angle setting.

The other option of course would be to create multiple bitmap images at the different angles and swap in the one that matches the angle you want when you need it.

Hi Stuart,

I guess you know what image I'm talking about... Pac-man ;-) 

I made that funny indicator to learn programming mql.

The best way to learn is to have a little fun, right?

I already have 4 bitmaps; open mouth left, closed mouth left, open mouth right, closed mouth right.

The open/closed mouth change per bar and left/right changes at bar 0 or above the visible bar on the right.

If it's not possible then I'll leave it that, because it is totally useless besides it's funny.

If there still is a way(and I hope so), I can add it to the code to make it optically look nicer.

Thanks. 

Vladimir Karputov
Moderator
45817
Vladimir Karputov 2016.01.24 15:18  
MQL5 language does not allow rotate objects.
Benjamin Nicola
1381
Benjamin Nicola 2016.01.24 15:37  
Karputov Vladimir:
MQL5 language does not allow rotate objects.

Thanks.

Is OBJPROP_ANGLE then only to set the angle of OBJ_TEXT

Stuart Browne
5813
Stuart Browne 2016.01.24 15:39  
Benjamin Nicola:

Hi Stuart,

I guess you know what image I'm talking about... Pac-man ;-) 

I made that funny indicator to learn programming mql.

The best way to learn is to have a little fun, right?

I already have 4 bitmaps; open mouth left, closed mouth left, open mouth right, closed mouth right.

The open/closed mouth change per bar and left/right changes at bar 0 or above the visible bar on the right.

If it's not possible then I'll leave it that, because it is totally useless besides it's funny.

If there still is a way(and I hope so), I can add it to the code to make it optically look nicer.

Thanks. 

Hey Ben 

I love that pacman mate!! :)

As I said above, and after more research, I don't believe there is a bitmap angle. But I'd really like to see what you can come up with using the work-around I mentioned above!

Cheers
Stu

Vladimir Karputov
Moderator
45817
Vladimir Karputov 2016.01.24 15:44  
Benjamin Nicola:

Thanks.

Is OBJPROP_ANGLE then only to set the angle of OBJ_TEXT

Yes.
Benjamin Nicola
1381
Benjamin Nicola 2016.01.24 16:02  
Karputov Vladimir:
Yes.
Ok, thanks.
Benjamin Nicola
1381
Benjamin Nicola 2016.01.24 16:16  
Stuart Browne:

Hey Ben 

I love that pacman mate!! :)

As I said above, and after more research, I don't believe there is a bitmap angle. But I'd really like to see what you can come up with using the work-around I mentioned above!

Cheers
Stu

Hi Stu,

I'm glad you like it.

It's a bit more work than setting an angle, but I can add 4 more images of packman in there.

On PointO and Range bar charts it would be perfect. (if the MA is set to period=1)

Ok, I'll make it and let you know when it's finished :-) 

To add comments, please log in or register