mayo Administrator

Joined: 14 Jun 2009 Posts: 700
|
Posted: 13/11/2011 22:09 Post subject: A Delphi-friendly way to simplify GDI+ functionality! |
|
|
A Delphi-friendly way to simplify GDI+ functionality!
HELP OPEN SOURCE COMMUNITY..HELP BOIAN ON THIS PROJECT....
http://mitov.users.sourceforge.net/
The free open source library allows quick and easy implementations of complex GDI+ applications, in a normal Delphi-friendly code.
http://www.mitov.com/products/igdi+
http://www.mitov.com/tutorials
[img]http://www.mitov.com/system/shots/43/original/IGDIPlusDemo.jpg?1311195121[/img]
... you write code like this
| Code: | procedure TForm1.FormPaint(Sender: TObject);
var
AGraphics : IGPGraphics;
AFont : IGPFont;
ALeftTopCorner : TGPPointF;
ARect : TGPRectF;
ARect1 : TGPRectF;
APath : IGPGraphicsPath;
begin
AGraphics := TGPGraphics.Create( Canvas );
AGraphics.SmoothingMode := SmoothingModeAntiAlias;
AGraphics.TextRenderingHint := TextRenderingHintAntiAlias;
ALeftTopCorner := MakePointF( 20, 20 );
AFont := TGPFont.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(
TGPPen.Create( TGPLinearGradientBrush.Create( GPInflateRectF( ARect1, 2, 2 ), aclRed, aclBlue, LinearGradientModeVertical ), 4 ),
TGPPathGradientBrush.Create(
TGPGraphicsPath.Create().AddRoundRectangleF( ARect1, MakeSizeF( 20, 20 ) )
)
.SetInterpolationColorsArrays( [ aclGreen, aclCyan, aclYellow ], [ 0, 0.3, 1 ] )
.SetCenterPointF( MakePointF( 250, 50 ))
.SetFocusScales( 0.87, 0.2 ),
ARect1, MakeSizeF( 20, 20 ) );
// Draw a text with semitransparent shadow.
AGraphics.DrawString( 'Welcome to IGDI+',
AFont,
MakePointF( 23, 23 ),
TGPSolidBrush.Create( MakeARGBColor( 50, aclBlack )) )
.DrawString( 'Welcome to IGDI+',
AFont,
ALeftTopCorner,
TGPLinearGradientBrush.Create( ARect, aclRed, aclBlue, LinearGradientModeForwardDiagonal ));
// Draw a closed curve.
AGraphics.DrawClosedCurveF( TGPPen.Create( aclRed, 3 ), TGPSolidBrush.Create( aclBlue ),
[
MakePointF( 60, 160 ),
MakePointF( 150, 180 ),
MakePointF( 200, 140 ),
MakePointF( 180, 220 ),
MakePointF( 120, 200 ),
MakePointF( 80, 260 )
] );
// Draw a semitransparent star.
APath := TGPGraphicsPath.Create();
APath.AddLinesF(
[
MakePointF( 75, 0 ),
MakePointF( 100, 50 ),
MakePointF( 150, 50 ),
MakePointF( 112, 75 ),
MakePointF( 150, 150 ),
MakePointF( 75, 100 ),
MakePointF( 0, 150 ),
MakePointF( 37, 75 ),
MakePointF( 0, 50 ),
MakePointF( 50, 50 )
] );
AGraphics.TranslateTransform( 420, 30 )
.FillPath(
TGPPathGradientBrush.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(
TGPPen.Create( aclRed, 3 ),
TGPLinearGradientBrush.Create( MakePointF( 0, 0 ), MakePointF( 20, 20 ), aclYellow, aclGreen )
.SetWrapMode( WrapModeTileFlipX ),
0, 0, 200, 80 );
end;
|
IGDI+ on SourceFourge.net
IGDI+ is now available on SourceForge: https://sourceforge.net/projects/igdiplus/ . An SVN repository is used. We are in process of adding all the source files.
You can access the SVN repository here: https://igdiplus.svn.sourceforge.net/svnroot/igdiplus directly or by using SVN :
svn co https://igdiplus.svn.sourceforge.net/svnroot/igdiplus igdiplus
Please let us know if you are interested in contributing to the project development so we can consider adding you to the list of project members.
| Code: | About SourceForge.net:
SourceForge.net is the world's largest provider of hosting for Open Source software development projects. SourceForge.net provides a variety of services to projects, including a download mirror network, collaborative development tools (like CVS and Subversion), and tools to support discussion and support. These services are provided to projects and their end-users free-of-charge.
About Open Source:
Of benefit to users, Open Source software is licensed so you can download and use the software free-of-charge. The source code for this software is made available free-of-charge, you (or a programmer you hire) can make changes to this software to better meet your needs, and you can release your changed code back to the community passing the benefit on to other users. |
See also.. OpenWire Editor, With OpenWire Editor you see the big picture and edit data flow and filter logic by simply connecting "wires" to components!
http://www.youtube.com/watch?feature=player_embedded&v=UN-LXwrn-8E# ! |
|