거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

cIntBMP - a library for creation of BMP images - MetaTrader 5용 라이브러리

조회수:
5726
평가:
(31)
게시됨:
2011.02.10 17:59
업데이트됨:
2016.11.22 07:32
\MQL5\Include\
cintbmp.mqh (39.29 KB) 조회
\MQL5\Experts\
ebmp.mq5 (48.02 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This class is designed for creation of bmp images.

Examples:

An example of DrawTriangle() method of cIntBMP class

An example of DrawTriangle() method

An example of DrawRectangle() method of cIntBMP class

An example of DrawRectangle() method

An example of DrawCircle() method of cIntBMP class

An example of DrawCircle() method

An example of Fill() method of cIntBMP class

An example of Fill() method

Usage:

The cIntBMP.mqh file should be located in MQL5/Include folder. The demo of cIntBMP class usage is located in the eBMP.mq5 file. Copy this file to the MQL5/Experts folder, open it in MetaEditor, compile and attach to the chart.

Using cIntBMP class:

1. Include file with class:

#include <cIntBMP.mqh>

2. Delcare the cIntBMP class variable, for example "bmp":

cIntBMP bmp;

3. Set image size and background color (using Create(...) method, see below).

4. Draw on the image.

5. Save (using the Save(...) method).

6. Show (using the Show(...) method);

When finished:

1. Delete graphic object (using the Hide(...) method).

2. Delete the file (using the Delete(...) method).

Class Methods:

  • Create(int aSizeX, int aSizeY, int aBGColor) - Sets image size and background color.
    aSizeX - width (in pixels);
    aSizeY - height (in pixels);
    aBGColor - background color;
  • SetDrawWidth(int aWidth) - Sets pen width.
    aWidth - pen width.
  • DrawDot(int aX, int aY, int aColor) - Draws a dot.
    aX - X coordinate;
    aY - Y cooordinate;
    aColor - color;
  • DrawLine(int aX1,int aY1, int aX2, int aY2, int aColor) - Draws a line.
    aX1, aY1 - starting coordinates;
    aX2, aY2 - ending coordinates;
    aColor - color;
  • DrawRectangle(int aX1, int aY1, int aX2, int aY2, int aColor, bool aSolid=false) - Draws a rectangle.
    aX1, aY1 - coordinates of the upper left corner;
    aX2, aY2 - coordinates of the lower right corner;
    aColor - color;
    aSolid - true - filled.
  • DrawTriangle(int aX1, int aY1, int aX2, int aY2, int aX3, int aY3, int aColor, bool aSolid=false) - Draws a triangle.
    aX1, aY1, aX2, aY2, aX3, aY3 - edge coordinates;
    aColor - color;
    aSolid - true - filled.
  • DrawCircle(int aX, int aY, int aRadius1, int aRadius2, int aColor, double aRatio=1.0, double aAngleFrom=0.0, double aAngleTo, bool aSolid=false) - Draws a circle.
    aX - X coordinate;
    aY - Y coordinate;
    aRadius1 - radius of the 1st circle;
    aRadius2 - radius of the 2nd circle;
    aColor - color;
    aRatio - ratio (ratio=1, circle, overwise ellipse).
    aAngleFrom - starting angle;
    aAngleTo - ending angle. if aAngleFrom=aAngleTo, it will draw a circle;
    aSolid - true - filled circle/ellipse.
  • Fill(int aX, int aY, int aColor) - Fills the area.
    aX, aY - coordinates of the fill area;
    aColor - fill color.
  • TypeText(int aX, int aY, int aColor) - Prints text on the image.
    aX, aY - coordinates of the left upper corner of the text;
    aColor - text color.
  • Save(string aFileName, bool aToImages=true) - saves the created image to file.
    aFileName - File name (it isn't necessary to specify the extension) ;
    aToImages - file will be saved to the MQL5\Images\ folder, overwise it will be saved to the MQL5\Files\ folder.
  • Show(int aX, int aY, string aBMPFileName, string aObjectName) - Shows the image on the chart.
    aX, aY - coodinates;
    aBMPFileName - file name of the image;
    aObjectName - graphic object of OBJ_BITMAP_LABEL type.
  • Hide(string aObjectName) - Deletes graphic object with the specified name.
    aObjectName - name of the object to delete.
  • Delete(string aFileName, bool aFromImages=true) - Deletes a file.
    aFileName - Name of the bmp file to delete (without path, it isn't necessary to specify the extension);
    aFromImages - if true, the file will be deleted from MQL5\Images\ folder, overwise it will be deleted from MQL5\Files\ folder.

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/251

TrendMagic TrendMagic

The Trend Magic indicator.

eKeyboardTrader eKeyboardTrader

The Expert Advisor allows to trade using the keyboard.

Demo_Create_OBJ_BITMAP_LABEL_EA Demo_Create_OBJ_BITMAP_LABEL_EA

The example of button, created using the object of OBJ_BITMAP_LABEL type.

Demo_Create_OBJ_BITMAP_Script Demo_Create_OBJ_BITMAP_Script

The example of chart background image, created using the object of OBJ_BITMAP type.