Bibliotecas: cIntBMP - uma biblioteca para a criação de imagens BMP

 

cIntBMP - uma biblioteca para a criação de imagens BMP:

Esta classe foi projetada para criar imagens BMP.

Um exemplo do método DrawTriangle() da classe cIntBMP

Um exemplo do método DrawTriangle()

Um exemplo do método DrawRectangle() da classe cIntBMP

Um exemplo do método DrawRectangle()

Um exemplo do método DrawCircle() da classe cIntBMP

Um exemplo do método DrawCircle()

Um exemplo do método Fill() da classe cIntBMP

Um exemplo do método Fill()

Autor: Dmitry Fedoseev

 
No Windows 7 de 64 bits não funciona.
 
barnix:
No Windows 7 de 64 bits não funciona.
Corrigido. Faça o download novamente.
[Excluído]  

Estou tentando criar um transparente. Mas ele não funciona. Você poderia encontrar um erro. Ou uma das funções cIntBMP Trasnparent Add.

//+------------------------------------------------------------------+
//|teste.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"
//+------------------------------------------------------------------+
//| Função de início do programa 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);


  }
//+------------------------------------------------------------------+

/* rotina de mistura alfa */
int AlphaBlend(int bg, int src)
{
int alpha = 100;
return (src * alpha / 255 + bg * (255 - alpha) / 255);

   int a = src >> 24;    /* alfa */
 
   /* Se o pixel de origem for transparente, retorne apenas o plano de fundo */
   if (0 == a) return (bg);

   /* mistura alfa das cores de origem e de fundo */
 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:

Ou uma função cIntBMP Trasnparent Add.

Você não precisa dessa função, pois precisará recalcular e atualizar a imagem inteira a cada tick. A máquina é de ferro, mas deixe-a lidar com tarefas mais úteis.
 
Existe alguma possibilidade de usar essa biblioteca SEM a dll que ela chama ( funções de arquivo dentro do código)?
 
Pessoal, talvez haja outras maneiras de melhorar a imagem?
 
Dmitry Fedoseev cada tique. A máquina é de ferro, mas deixe-a lidar com tarefas mais úteis.

Quer dizer que a única maneira de ter transparência nesses objetos retângulo e triângulo é reproduzindo a solução que temos aqui neste artigo? Estudando a classe CCanvas. Como desenhar objetos transparentes - Artigos 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.