ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IEGDIPlus and EndCaps
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Mar 29 2015 :  17:45:22  Show Profile  Reply
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

xequte

38507 Posts

Posted - Mar 31 2015 :  11:45:32  Show Profile  Reply
Hi Bill

I'll investigate when I am back in the office.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: