Problem with OBJ_BITMAP_LABEL not showing the content properly

To add comments, please log in or register
Joe
7
Joe  

Hi all,

i am new to mql4 programming and i would really appriciate your help. I am trying to place a custom picture on the chart. I looked all over for working solution but i can not find it. I followed the example on MQL4 documentation but i can not figure out what i am doing wrong. Could someone with more experience please take a look and let me know what i am doing wrong ?


The entire EA code:

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   Alert ("random stuff test ON");

   ObjectCreate(0,"BmpLabel",OBJ_BITMAP_LABEL,0,0,0);   
   ObjectSetString(0,"BmpLabel",OBJPROP_BMPFILE,0,"\\Images\\123.bmp");
   ObjectSetInteger(0,"BmpLabel",OBJPROP_XDISTANCE,200);   //x
   ObjectSetInteger(0,"BmpLabel",OBJPROP_YDISTANCE,200);   //y
   ObjectSetInteger(0,"BmpLabel",OBJPROP_XSIZE,30); // width
   ObjectSetInteger(0,"BmpLabel",OBJPROP_YSIZE,30); // height
   ObjectSetInteger(0,"BmpLabel",OBJPROP_HIDDEN,false);
   
   
   return(0);
  }

int deinit()
  {
   Alert ("random stuff test OFF");

   return(0);
  }


The picture is in the MQL4/Images folder. It is in bmp file format and it has 30x30 pixels dimensions.

The code above just creates empty bitmap lable object but no picture is visible..


Empty label object


Thank you so much for the help.

Files:
Alain Verleyen
38619
Alain Verleyen  
Your bitmap is using compression, which is not managed by OBJ_BITMAP_LABEL. Save it without compression (I opened it with Paint and save it without change, and after that it displayed).
Joe
7
Joe  
Alain Verleyen:
Your bitmap is using compression, which is not managed by OBJ_BITMAP_LABEL. Save it without compression (I opened it with Paint and save it without change, and after that it displayed).
Thank you so much. Yes it works now. This would have never crossed my mind.
To add comments, please log in or register