라이브러리: cIntBMP - BMP 형식의 이미지 생성을 위한 라이브러리

 

cIntBMP - BMP 형식의 이미지 생성을 위한 라이브러리:

BMP 형식의 이미지를 생성하고 표시하는 클래스입니다.

cIntBMP - BMP 형식의 이미지 생성을 위한 라이브러리

Author: Dmitry Fedoseev

 
Windows 7 64비트에서는 작동하지 않습니다.
 
barnix:
Windows 7 64비트에서 작동하지 않습니다.
수정되었습니다. 다시 다운로드하세요.
[삭제]  

투명한 것을 만들려고 합니다. 하지만 작동하지 않습니다. 버그를 찾을 수 있습니다. 또는 cIntBMP Trasnparent 추가 함수 중 하나.

//+------------------------------------------------------------------+
//|test.mq5 |
//| 저작권 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"
//+------------------------------------------------------------------+
//| 스크립트 프로그램 시작 기능|
//+------------------------------------------------------------------+

#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;    /*역주: 알파 */
 
   /* 소스 픽셀이 투명하면 배경만 반환합니다 */.
   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)   );
}
 
FinGeR:

또는 cIntBMP Trasnparent 추가 함수 하나.

이러한 함수는 필요하지 않으며 매 틱마다 전체 이미지를 다시 계산하고 업데이트해야 합니다. 기계는 철이지만 더 유용한 작업을 처리하게 하세요.
 
이 라이브러리를 호출하는 dll 없이도 사용할 수 있나요? (코드 내부의 파일 함수 )
 
여러분, 사진을 더 잘 찍을 수 있는 다른 방법이 있을까요?
 
Dmitry Fedoseev 매 틱마다 전체 이미지를 다시 계산하고 업데이트해야 합니다. 기계는 철이지만 더 유용한 작업을 처리하게 하세요.

직사각형과 삼각형 객체에 투명성을 부여하는 유일한 방법은 이 글에서 소개한 솔루션을 재현하는 것뿐이라는 뜻인가요? CCanvas 클래스를 공부해 보세요. 투명한 오브젝트를 그리는 방법 - MQL5 문서

Studying the CCanvas Class. How to Draw Transparent Objects
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.