Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.10.14;
Скачать: CL | DM;

Вниз

GDI+   Найти похожие ветки 

 
Кирилл_А   (2007-08-02 19:14) [0]

Скажите, а как в GDI+ использовать аналоги SetRop2.
2 полигона накладываются, у них есть общая часть, хочется ее нарисовать смешанным цветом.
SetRop2(DC,10) - помогало в GDI.
Спасибо.


 
Инс ©   (2007-08-02 19:19) [1]

Я бы лучше закрашивал полигоны кистью с альфаканалом. Смотрелось бы красиво :)


 
Rouse_ ©   (2007-08-02 21:44) [2]

Ты демки под GDI++ качал?


 
Кирилл_А   (2007-08-02 22:37) [3]

Да, но с полигонами, особенно с 2 - там не было.


 
Rouse_ ©   (2007-08-03 09:20) [4]

...\Alpha Blending Lines and Fills\Using Compositing Mode to Control Alpha Blending\

Procedure OnPaint(DC: HDC);
var
 bitmapGraphics, Graphics : TGPGraphics;
 Bitmap: TGPBitmap;
 redBrush, greenBrush, brush: TGPSolidBrush;
begin

 // Create a blank bitmap.
 Bitmap := TGPBitmap.Create(180, 100, PixelFormat32bppARGB);

 // Create a Graphics object that we can use to draw on the bitmap.
 bitmapGraphics := TGPGraphics.Create(bitmap);

 // Create a red brush and a green brush, each with an alpha value of 160.
 redBrush := TGPSolidBrush.Create(MakeColor(210, 255, 0, 0));
 greenBrush := TGPSolidBrush.Create(MakeColor(210, 0, 255, 0));

 // Set the compositing mode so that when we draw overlapping ellipses,
 // the colors of the ellipses are not blended.
 bitmapGraphics.SetCompositingMode(CompositingModeSourceCopy);

 // Fill an ellipse using a red brush that has an alpha value of 160.
 bitmapGraphics.FillEllipse(redBrush, 0, 0, 150, 70);

 // Fill a second ellipse using green brush that has an alpha value of 160.
 // The green ellipse overlaps the red ellipse, but the green is not
 // blended with the red.
 bitmapGraphics.FillEllipse(greenBrush, 30, 30, 150, 70);

 Graphics := TGPGraphics.Create(DC);

 Graphics.SetCompositingQuality(CompositingQualityGammaCorrected);

 // Draw a multicolored background.
 brush := TGPSolidBrush.Create(aclAqua);
 Graphics.FillRectangle(brush, 200, 0, 60, 100);
 brush.SetColor(aclYellow);
 Graphics.FillRectangle(brush, 260, 0, 60, 100);
 brush.SetColor(aclFuchsia);
 Graphics.FillRectangle(brush, 320, 0, 60, 100);

 // Display the bitmap on a white background.
 Graphics.DrawImage(bitmap, 0, 0);

 // Display the bitmap on a multicolored background.
 Graphics.DrawImage(bitmap, 200, 0);

 bitmapGraphics.Free;
 Bitmap.Free;
 redBrush.Free;
 greenBrush.Free;
 brush.Free;
 graphics.Free;
end;



Страницы: 1 вся ветка

Текущий архив: 2007.10.14;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.024 c
2-1190016964
Kolan
2007-09-17 12:16
2007.10.14
Exception в TObjectList при Add, из-за чего может быть?


2-1189763049
Lebedev
2007-09-14 13:44
2007.10.14
MMSYSTEM281 в ОС WIN98, с прогой Delphi (MediaPlayer).


2-1190529112
zavialov
2007-09-23 10:31
2007.10.14
Не увеличивать счетчик ссылок - создать отдельный экземпляр.


2-1190207865
AigizK
2007-09-19 17:17
2007.10.14
Как подключить файл


4-1176573654
Dmitry_177
2007-04-14 22:00
2007.10.14
SelectDirectory в центре экрана