When using IEGDIPlus how do you draw a line with square ends, when UseGDIPlus is False?
iIECanvas := TIECanvas.Create(ImageEnView1.IEBitmap.Canvas,
AntiAlias1.Checked, UseGDIPlus1.Checked, ImageEnView1.Bitmap);
iPenColor := PenColor1.Selected;
iPenAlpha := StrToIntDef(PenAlpha1.Text, 255);
iIECanvas.Pen.Color := iPenColor;
iIECanvas.Pen.Style := psSolid;
iIECanvas.Pen.Width := iPenSize;
iIECanvas.Brush.Color := iPenColor;
iIECanvas.Brush.BackColor := iPenColor;
iIECanvas.Brush.Style := bsClear;
iIECanvas.Brush.Transparency := iPenAlpha;
if iPenSize > 1 then
begin
iLogBrush.lbStyle := BS_Solid;
iLogBrush.lbColor := iPenColor;
iLogBrush.lbHatch := 0;
iIECanvas.Pen.Handle := ExtCreatePen(PS_Geometric or PS_Solid or
PS_ENDCAP_SQUARE, iPenSize, iLogBrush, 0, nil);
end
else
begin
iIECanvas.Pen.Color := iPenColor;
iIECanvas.Pen.Width := iPenSize;
iIECanvas.Pen.Style := psSolid;
end;
iIECanvas.MoveTo(AStartX, AStartY);
iIECanvas.LineTo(ALastX, ALastY);
iIECanvas.Free();
This does not draw square ends.
You can not set the LogBrush.Pen.Color when drawing the alphachannel because when you do, the alphachannel is overwritten...
I think GDIPLus has a method do this but it is not part of IEGDIPlus: _GDIPlus_PenSetEndCap. Can this be added to IEGDIPlus?
When UseGDIPlus is True lines have square ends automatically.
Unfortunately, if USeGDIPlus is False lines have round ends.
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development