Downloads

partner_technology_small

IGDI+

 

TopBottomRight

 

 

 

 

IDGIPlus

About IGDI+

IGDI+ is a free open source Delphi library wrapping in a Delphi friendly way the Microsoft GDI+ functionality.

The library allows very easy and short implementations of complex GDI+ applications, in a natural Delphi friendly code.

RADStudio_compatible_btn Delphi_compatible_btn CBuilder_compatible_btn DelphiPrism_compatible_btn

IGDI+ on SourceForge.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.

Donate to the IGDI+ project

If you like the technology, and are willing to help us continue working on it, you can donate using the link bellow: 

Here are some of the specifics:

  • All GDI+ objects are accessed trough interfaces, with automatic release of resources.
  • All data types are either Delphi objects, records or arrays.
  • Most class member functions return pointer to the class allowing the next function to be called in the same line, thus simplifying the code.
  • All callbacks are wrapped into events.
  • The library directly integrates with TCanvas, TBitmap, and TIcon.
  • Whenever classes have similar functionality they expose common interface for code reusability.
  • All errors are handled trough exceptions for simplified error handling, and code reduction.
  • The library also adds a number of functions missing in GDI+ such as rounded rectangles, and combined Pen and Brush drawing functions.
  • All functions using pointers in C++ are redesigned to accept or return Delphi arrays.

Here is example of relatively complex IGDI+ rendering with the corresponding source code. As it is obvious most of the shapes are rendered with a single expression.

Example:

IGDIPlusDemo

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;
 

 

Supported Platforms:

RADStudio2007 TO Delphi5

  • Delphi 5
  • Delphi 6
  • Delphi 7
  • Delphi 2005
  • C++ Builder 5
  • C++ Builder 6
  • BDS 2006
  • Delphi 2006
  • C++ Builder 2006
  • Turbo Delphi 2006
  • Turbo C++ 2006
  • Delphi 2007
  • C++ Builder 2007
  • RAD Studio 2007
  • Delphi 2009
  • C++ Builder 2009
  • RAD Studio 2009
  • Delphi 2010
  • C++ Builder 2010
  • RAD Studio 2010

The following products contain and utilize the IGDI+. They are free for non commercial purposes:

PlotLabSmallDim
IntelligenceLabSmall
BasicAudioSmallDim


For more information: