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
 ImageEn 4.x Feature Request
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

nwscomps

185 Posts

Posted - Jul 13 2011 :  07:07:19  Show Profile  Reply
I have a feature request for Imageen 4.x
In the iegdiplus.pas unit I would like the ability to draw lines and any other drawing primitive using floating point precision.
I see that the required entry point for the gdiplus.dll function already exists for that, but it is not used with floating point values.
So I have added a few lines of code to the iegdiplus unit and to the TIECanvas class.
I hope to see something like this (or equivalent) implemented in next version of ImageEn 4 (of which I have just purchased the yearly subscription)
So here's the code I am using, in order to draw a path of lines with floating point precision.
This modification is very important to draw nicely antialiased paths, when you need subpixel accuracy, which is always needed
when drawing for example curves and complex paths.

//Francesco Savastano --START PATCH (declares a type to handle a floating point precision Point)
TIECanvasDoublePoint = record
X: double;
Y: double;
end;
TIECanvasDoublePointArray = array of TIECanvasDoublePoint;
//Francesco Savastano --END PATCH




//Francesco Savastano --START PATCH
procedure DrawLinesPath(thePoints: TIECanvasDoublePointArray);
//Francesco Savastano --END PATCH


//Francesco Savastano --START PATCH
procedure TIECanvas.DrawLinesPath(thePoints: TIECanvasDoublePointArray);
var
Path: pointer;
i: integer;
begin
IE_GdipCreatePath(0, Path);
try
for i := 0 to high(thePoints) - 1 do
begin
IE_GdipAddPathLine(Path, thePoints[i].X, thePoints[i].Y,
thePoints[i+1].X, thePoints[i+1].Y);
end;

IE_GdipDrawPath(FGraphics,FPen.FGHandle, Path);
finally
IE_GdipDeletePath(Path);
end;
end;
//Francesco Savastano --END PATCH

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library

nwscomps

185 Posts

Posted - Jul 14 2011 :  10:35:55  Show Profile  Reply
Any Comment on the viability of my request? Maybe from Fabrizio?
Thanks

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

fab

1310 Posts

Posted - Jul 15 2011 :  09:33:52  Show Profile  Reply
Thank you Francesco!

I just added your changes. Now TIECanvas has DrawLinesPath method.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: