Lazarus,CodeTyphon和Delphi的修改後的IgDiplus庫。
Delphi的免費和開源庫。它允許在天然Pascal友好的代碼中快速簡便地實現複雜的GDI+應用程序。
作者:Boian Mitov
主頁:http://mitov.com/products/igdi+#overview
http://mitov.com/products/igdi+#license
該軟件提供了“原樣”,而無需任何明示或暗示的保證。在任何情況下,作者都不應對使用此軟件造成的任何損害負責。
授予任何人,包括任何目的,包括商業應用程序,並將其更改並自由地重新分配,但要予以自由限制:
該軟件的起源不得歪曲,您不得聲稱自己編寫了原始軟件。如果您在產品中使用此軟件,則將對產品文檔的確認表示讚賞,但不需要。
更改的源版本必須明確標記為此類版本,並且不得將其歪曲為原始軟件。
本通知不得從任何源分佈中刪除或更改。
您可以隨心所欲地使用我的代碼,而無需任何限制。
IGDIPlusHelpers.pas , IGDIPlusAPI_FPC.inc , IGDIPlusAPI_DCC.inc 。原始IgDiplus演示應用程序與Lazarus編輯。

其他演示 - 色輪

演示1主要程序。
procedure TForm1.FormPaint (Sender: TObject);
var
AGraphics : IGPGraphics;
AFont : IGPFont;
ALeftTopCorner : TPointF;
ARect : TIGPRectF;
ARect1 : TIGPRectF;
APath : IGPGraphicsPath;
begin
AGraphics := TIGPGraphics.Create( Canvas );
AGraphics.SmoothingMode := SmoothingModeAntiAlias;
AGraphics.TextRenderingHint := TextRenderingHintAntiAlias;
ALeftTopCorner := TPointF.Create( 20 , 20 );
AFont := TIGPFont.Create( ' Microsoft Sans Serif ' , 40 , [ fsBold ] );
ARect := AGraphics.GetStringBoundingBoxF( ' Welcome to IGDI+ ' , AFont, ALeftTopCorner );
ARect1 := GPInflateRectF( ARect, 10 , 10 );
// Draw a fancy rounded rectangle.
AGraphics.DrawRoundRectangleF(
TIGPPen.Create( TIGPLinearGradientBrush.Create( GPInflateRectF( ARect1, 2 , 2 ), aclRed, aclBlue, LinearGradientModeVertical ), 4 ),
TIGPPathGradientBrush.Create(
TIGPGraphicsPath.Create().AddRoundRectangleF( ARect1, TIGPSizeF.Create( 20 , 20 ) )
)
.SetInterpolationColorArrays( [ aclGreen, aclCyan, aclYellow ], [ 0 , 0.3 , 1 ] )
.SetCenterPointF( TPointF.Create( 250 , 50 ))
.SetFocusScales( 0.87 , 0.2 ),
ARect1, TIGPSizeF.Create( 20 , 20 ) );
// Draw a text with semitransparent shadow.
AGraphics.DrawStringF( ' Welcome to IGDI+ ' ,
AFont,
TPointF.Create( 23 , 23 ),
TIGPSolidBrush.Create( MakeARGBColor( 50 , aclBlack )) )
.DrawStringF( ' Welcome to IGDI+ ' ,
AFont,
ALeftTopCorner,
TIGPLinearGradientBrush.Create( ARect, aclRed, aclBlue, LinearGradientModeForwardDiagonal ));
// Draw a closed curve.
AGraphics.DrawClosedCurveF( TIGPPen.Create( aclRed, 3 ), TIGPSolidBrush.Create( aclBlue ),
[
TPointF.Create( 60 , 160 ),
TPointF.Create( 150 , 180 ),
TPointF.Create( 200 , 140 ),
TPointF.Create( 180 , 220 ),
TPointF.Create( 120 , 200 ),
TPointF.Create( 80 , 260 )
] );
// Draw a semitransparent star.
APath := TIGPGraphicsPath.Create();
APath.AddLinesF(
[
TPointF.Create( 75 , 0 ),
TPointF.Create( 100 , 50 ),
TPointF.Create( 150 , 50 ),
TPointF.Create( 112 , 75 ),
TPointF.Create( 150 , 150 ),
TPointF.Create( 75 , 100 ),
TPointF.Create( 0 , 150 ),
TPointF.Create( 37 , 75 ),
TPointF.Create( 0 , 50 ),
TPointF.Create( 50 , 50 )
] );
AGraphics.TranslateTransform( 420 , 30 )
.FillPath(
TIGPPathGradientBrush.Create( APath )
.SetCenterColor( MakeColor( 200 , 255 , 0 , 0 ))
.SetSurroundColors(
[
MakeColor( 80 , 0 , 0 , 0 ),
MakeColor( 80 , 0 , 255 , 0 ),
MakeColor( 80 , 0 , 0 , 255 ),
MakeColor( 80 , 255 , 255 , 255 ),
MakeColor( 80 , 0 , 0 , 0 ),
MakeColor( 80 , 0 , 255 , 0 ),
MakeColor( 80 , 0 , 0 , 255 ),
MakeColor( 80 , 255 , 255 , 255 ),
MakeColor( 80 , 0 , 0 , 0 ),
MakeColor( 80 , 0 , 255 , 0 )
] ),
APath );
// Draw rotated ellipse.
AGraphics.ResetTransform()
.TranslateTransform( 300 , 160 )
.RotateTransform( 30 )
.DrawEllipseF(
TIGPPen.Create( aclRed, 3 ),
TIGPLinearGradientBrush.Create( TPointF.Create( 0 , 0 ), TPointF.Create( 20 , 20 ), aclYellow, aclGreen )
.SetWrapMode( WrapModeTileFlipX ),
0 , 0 , 200 , 80 );
end ;在包裝目錄中,您會找到Delphi XE2-10.3 Rio的軟件包。安裝適當的軟件包(DPK文件),然後在IDE選項中,使用IGDIPlus.pas文件添加到庫路徑目錄。
您有兩個選擇:
packagesLazaruslazigdiplus.lpk軟件包。LazIGDIPlus添加到所需的包裝中。IGDIPlus.pas文件的目錄添加到編譯器選項- >路徑- >其他單元文件。如拉撒路(Lazarus)一樣,僅使用安裝程序包的文件是packagesCodeTyphonlazigdiplus.ctpkg 。
23.01.2020
Delphi XE2和XE3支持。
添加了Delphi XE2-10.3 Rio的軟件包。
為XE2添加了主演示,XE2和XE7的色輪演示。
IgDiplushelpers:一些與HatchStyle轉換有關的助手例程。
19.01.2020
添加了拉撒路和CodeTyphon的軟件包。
15.01.2020
最初的釋放,並帶有免費的Pascal支持。