I would guess with the offset you are pushing the BMP outside the visible area defined by size.t
@Dominik Egert and @@Marco vd Heijden Thank you for your reply i did try to change the ofsets and still nothing is visible ,I am attaching a screenshot as well
another strange thing i noticed is when i give the bmp image name to something that does not exist in images folder , i dont get any error ? it should give some sort of error that the image does not exist or something ?
@Dominik Egert and @@Marco vd Heijden Thank you for your reply i did try to change the ofsets and still nothing is visible ,I am attaching a screenshot as well
another strange thing i noticed is when i give the bmp image name to something that does not exist in images folder , i dont get any error ? it should give some sort of error that the image does not exist or something ?
Click on Edit... to get the properties, this is not really showing any details at the moment. - Screenshot not heplful.
To get an error, you need to check the return value of ObjectSet...()
Something like this maybe:
if(!ObjectSetString(0,name,OBJPROP_BMPFILE,"Images\\lab.bmp")) { printf("Error creating bmp. Error code: %i", GetLastError()); }
Here is a snippet of my code and how I am doing it:
// Create Canvas resource const int add_data = ArraySize(obj_data); ArrayResize(obj_data, add_data + 1); obj_list[object_idx(obj_name)].data_idx = add_data; obj_data[add_data].width = _c_width; obj_data[add_data].height = _c_height; obj_data[add_data].clr = txtColor; obj_data[add_data].bgclr = (color)bg_clr; obj_data[add_data].flags |= (0x01 * bottom_up); obj_data[add_data].flags |= (0x02 * term_colors); obj_data[add_data].flags |= (font_size << 56); obj_list[object_idx(obj_name)].chart_id = chart_id; obj_list[object_idx(obj_name)].window_id = window_id; ResourceFree("::" + obj_name); ResourceCreate("::" + obj_name, textfield_bmp, width, height, NULL, NULL, width, COLOR_FORMAT_ARGB_RAW); // Create console output field ObjectCreate(chart_id, obj_name, OBJ_BITMAP_LABEL, window_id, NULL, NULL); ObjectSetInteger(chart_id, obj_name, OBJPROP_COLOR, clrNONE); ObjectSetInteger(chart_id, obj_name, OBJPROP_XDISTANCE, x_pos); ObjectSetInteger(chart_id, obj_name, OBJPROP_YDISTANCE, y_pos); ObjectSetInteger(chart_id, obj_name, OBJPROP_XSIZE, width); ObjectSetInteger(chart_id, obj_name, OBJPROP_YSIZE, height); ObjectSetInteger(chart_id, obj_name, OBJPROP_CORNER, CORNER_LEFT_UPPER); ObjectSetString(chart_id, obj_name, OBJPROP_TOOLTIP, (tooltip == NULL) ? "\n" : tooltip); ObjectSetInteger(chart_id, obj_name, OBJPROP_BACK, false); ObjectSetInteger(chart_id, obj_name, OBJPROP_SELECTABLE, false); ObjectSetInteger(chart_id, obj_name, OBJPROP_SELECTED, false); ObjectSetInteger(chart_id, obj_name, OBJPROP_HIDDEN, true); ObjectSetInteger(chart_id, obj_name, OBJPROP_ZORDER, NULL); ObjectSetString(chart_id, obj_name, OBJPROP_BMPFILE, NULL, "::" + obj_name);
Its incomlete code, but maybe it gives you an idea on how to do it. It works perfectly for me this way. (Used to render text)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello
I am trying to Create a bitmap label but its not working , i checked the object list on chart (CTRL+b) i can see that it created a label but the image isnt visible on chart.
Here is the code :
What i have tried:
I have tried This and This but these solution dint work for me .
Can someone please point out what am i doing wrong ?
Thanks