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 |