How to add Bitmap to the chart

 

Hi

I want to add a bitmap to the chart , i put the bmp file on the image folder and its work good (i see the photo on the chart)

but when i sent the EX5 file to my friend he dont see the photo on the chart  , just if i send him the bmp file and he put is on image folder then its work good , how can i send the EX5 file without the send the bmp file ?

 
Netanel Tanami :

Hi

I want to add a bitmap to the chart , i put the bmp file on the image folder and its work good (i see the photo on the chart)

but when i sent the EX5 file to my friend he dont see the photo on the chart  , just if i send him the bmp file and he put is on image folder then its work good , how can i send the EX5 file without the send the bmp file ?

Include the image in the * .ex5 file using the resource.

Documentation on MQL5: MQL5 programs / Resources
Documentation on MQL5: MQL5 programs / Resources
  • www.mql5.com
Resources - MQL5 programs - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Vladimir Karputov:

Include the image in the * .ex5 file using the resource.

Hi

i tried what you said  and still, i see the photo on my chart but when i send the file to my friend he dont see the photo




//+------------------------------------------------------------------+
//|                                                  LOGO TEST.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "2.00"
#resource "\\Images\\MYLOGO.bmp"

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   LOGO();
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
  }
//+------------------------------------------------------------------+

void LOGO()
{
     
    ObjectCreate(0, "LOGO", OBJ_BITMAP_LABEL, 0, 0, 0);
    
   ObjectSetString(0, "LOGO", OBJPROP_BMPFILE,0, "\\Images\\MYLOGO.bmp");

      ObjectSetInteger(0,"LOGO",OBJPROP_XDISTANCE,0,36); 
      ObjectSetInteger(0,"LOGO",OBJPROP_YDISTANCE,0,27);


     }
     
 
Netanel Tanami:

Hi

i tried what you said  and still, i see the photo on my chart but when i send the file to my friend he dont see the photo

Read the help carefully. No need to come up with non-existent commands - use the example from the help.

//+------------------------------------------------------------------+
//|                                                  LOGO TEST.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "2.00"
#resource "\\Images\\MYLOGO.bmp"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   LOGO();
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void LOGO()
  {
   ObjectCreate(0,"LOGO",OBJ_BITMAP_LABEL,0,0,0);
   ObjectSetString(0,"LOGO",OBJPROP_BMPFILE,0, "::Images\\MYLOGO.bmp");
   ObjectSetInteger(0,"LOGO",OBJPROP_XDISTANCE,0,36);
   ObjectSetInteger(0,"LOGO",OBJPROP_YDISTANCE,0,27);
//---
  }
//+------------------------------------------------------------------+


Run:

Files:
LOGO_TEST.ex5  8 kb
Reason: