How to add a custom image to the chart using an MT5 EA?

I’m currently coding an MT5 EA and I’d like to add an image/logo directly onto the chart (not just text or lines). I’ve been experimenting with OBJ_BITMAP and OBJ_BITMAP_LABEL, but I’m not fully sure how to properly load and display a custom image in the EA.

Has anyone here done this before?🤷‍♂️

What’s the correct way to load an image file into the chart?

Are there specific formats/sizes that work best (BMP, PNG, etc.)?

Any sample code or tips would be greatly appreciated.


Thanks in advance 🙏
Let’s share some knowledge here.
I’m sure many developers would find this useful too.
[Deleted]

Articles

Making charts more interesting: Adding a background

Daniel Jose, 2022.04.27 11:08

Many workstations contain some representative image which shows something about the user. These images make the working environment more beautiful and exciting. Let's see how to make the charts more interesting by adding a background.
Fernando Carreiro #:
Thanks 
Anold Stephen Minja #:
Thanks 
Currently I face the same, unable to fix INVALID RESOURCE PATH issue. 
[Deleted]

Rahat, the #resource declaration and OBJPROP_BMPFILE use different path forms.

For a BMP at MQL5\Images\logo.bmp, the declaration is #resource "\\Images\\logo.bmp". When assigning that embedded image to OBJPROP_BMPFILE, use "::Images\\logo.bmp": omit the declaration's leading root backslash after ::. These are documentation-based examples, not tested here.

A Windows drive path or a parent-folder ..\ segment is not valid in #resource. If this is a compiler error, check the declaration and file location first.

Could you post the exact #resource line, the ObjectSetString call and full error text, and say whether it appears in the compiler or the Experts log?

https://www.mql5.com/en/docs/runtime/resources

Documentation on MQL5: Resources / MQL5 programs
Documentation on MQL5: Resources / MQL5 programs
  • www.mql5.com
Programs in MQL5 allow working with sound and graphic files: PlaySound() plays a sound file; ObjectCreate() allows creating user interfaces using...