Windows 7 64ビットでは動作しません。
透明なものを作ろうとしているんだ。でもうまくいかない。バグがあるかもしれない。または、cIntBMP Trasnparent Add 関数を1つ使ってください。

//+------------------------------------------------------------------+ //|をテストします。mq5 //| Copyright 2011, MetaQuotes Software Corp. //|http://mql5.commql5.com //+------------------------------------------------------------------+ #property copyright "Copyright 2011, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00" //+------------------------------------------------------------------+ //| スクリプト番組開始機能| //+------------------------------------------------------------------+ #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); } //+------------------------------------------------------------------+ /* アルファ・ブレンド・ルーチン */ int AlphaBlend(int bg, int src) { int alpha = 100; return (src * alpha / 255 + bg * (255 - alpha) / 255); int a = src >> 24; /* alpha */ /* ソースピクセルが透明の場合、背景を返す */ if (0 == a) return (bg); /* 原色と背景色をアルファブレンドする。 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) ); }
みんな、もっといい写真を撮る方法が他にあるかもしれないよ?
Dmitry Fedoseev 刻み ごとに画像全体を再計算して更新する必要がある。マシンは鉄だが、もっと有用なタスクを処理させるようにしよう。
つまり、矩形や三角形のオブジェクトに透過性を持たせるには、この記事で紹介した解決策を再現するしかないということですか?CCanvas クラスを勉強しましょう。透明なオブジェクトを描く方法 - MQL5 Articles
Studying the CCanvas Class. How to Draw Transparent Objects
- www.mql5.com
Do you need more than awkward graphics of moving averages? Do you want to draw something more beautiful than a simple filled rectangle in your terminal? Attractive graphics can be drawn in the terminal. This can be implemented through the CСanvas class, which is used for creating custom graphics. With this class you can implement transparency, blend colors and produce the illusion of transparency by means of overlapping and blending colors.
取引の機会を逃しています。
- 無料取引アプリ
- 8千を超えるシグナルをコピー
- 金融ニュースで金融マーケットを探索
cIntBMP - BMP画像作成ライブラリ:
BMP画像の作成と出力のためのライブラリ
作者: Dmitry Fedoseev