Bibliothèque: cIntBMP - bibliothèque pour la création d'images au format BMP
J'essaie d'en créer un transparent. Mais cela ne fonctionne pas. Vous pourriez trouver un bug. Ou une fonction cIntBMP Trasnparent Add.

//+------------------------------------------------------------------+ //|test.mq5 | //| Copyright 2011, MetaQuotes Software Corp. //| http ://www.mql5.com //+------------------------------------------------------------------+ #property copyright "Copyright 2011, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00" //+------------------------------------------------------------------+ //| Fonction de démarrage du programme de script| //+------------------------------------------------------------------+ #import "user32.dll" int GetDC(int hwnd); int ReleaseDC(int hwnd,int hdc); #import "gdi32.dll" int GetPixel(int hdc,int x,int y); int SetPixel(int hdc,int x,int y, int c); #import void OnStart() { int i, H, V, shH=0, shV=0, header; double hgh; color screen [80][80]; color r, g, b, cv=Red; //--- long hwnd=ChartGetInteger(ChartID(),CHART_WINDOW_HANDLE); int hdc=GetDC((int)hwnd); for(V=0; V<80; V++) { for(H=0; H<80; H++) { screen[V][H]=GetPixel(hdc,V,H); } } for(V=0; V<80; V++) { for(H=0; H<80; H++) { cv=screen[V][H]; cv=AlphaBlend(cv ,clrRed ); SetPixel(hdc, V+shV,H+shH,cv); } } Sleep(3000); } //+------------------------------------------------------------------+ /* routine de mélange alpha */ int AlphaBlend(int bg, int src) { int alpha = 100; return (src * alpha / 255 + bg * (255 - alpha) / 255); int a = src >> 24; /* alpha */ /* Si le pixel source est transparent, il suffit de renvoyer l'arrière-plan */ if (0 == a) return (bg); /* mélange alpha des couleurs de la source et de l'arrière-plan */ int rb = (((src & 0x00ff00ff) * a) + ((bg & 0x00ff00ff) * (0xff - a))) & 0xff00ff00; int g = (((src & 0x0000ff00) * a) + ((bg & 0x0000ff00) * (0xff - a))) & 0x00ff0000; return ( (src & 0xff000000) | ((rb | g) >> 8) ); }
Ou une fonction cIntBMP Trasnparent Add.
Vous voulez dire que la seule façon d'avoir de la transparence sur ces objets rectangles et triangles est de reproduire la solution que nous avons ici dans cet article ? Étudier la classe CCanvas. Comment dessiner des objets transparents - Articles MQL5
- www.mql5.com
cIntBMP - bibliothèque pour la création d'images au format BMP:
Une classe pour créer et afficher des images au format BMP.
Author: Dmitry Fedoseev