A Delphi-friendly way to simplify GDI+ functionality!

 

  • Resource auto-release
  • Call chaining
  • Delphi Events as callbacks
  • Simplified error handling
  • Functions new to GDI+
  • Use TCanvas, TBitmap, TIcon
 

 

About IGDI+

The free open source library allows quick and easy implementations of complex GDI+ applications, in a natural Delphi-friendly code.

 

For example, to make this:

 

/system/shots/43/original/IGDIPlusDemo.jpg?1311195121

 
 
... you write code like this:
 

	
procedure TForm1.FormPaint(Sender: TObject);
begin
  var AGraphics := TIGPGraphics.Create( Canvas );
  AGraphics.SmoothingMode := TIGPSmoothingMode.AntiAlias;
  AGraphics.TextRenderingHint := TIGPTextRenderingHint.AntiAlias;
 
  var ALeftTopCorner := TPointF.Create( 20, 20 );
  var AFont := TIGPFont.Create( 'Microsoft Sans Serif', 40, [ fsBold ] );
  var ARect := AGraphics.GetStringBoundingBoxF( 'Welcome to IGDI+', AFont, ALeftTopCorner );
  var ARect1 := ARect.Inflate( 10, 10 );
 
  // Draw a fancy rounded rectangle.
  AGraphics.DrawRoundRectangleF(
              TIGPPen.Create( TIGPLinearGradientBrush.Create( ARect1.Inflate( 2, 2 ), aclRed, aclBlue, TIGPLinearGradientMode.Vertical ), 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, TIGPLinearGradientMode.ForwardDiagonal ));
 
 
  // 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.
  var 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( TIGPWrapMode.TileFlipX ),
              0, 0, 200, 80 );
end;
 
 
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: 
 
 

 

 

IGDI+ on GitHub
 
IGDI+ is now available on GitHub: https://github.com/bmitov/IGDIPlus . An GIT repository is used. We are in process of adding all the source files.
 
You can access the GIT repository here: https://github.com/bmitov/IGDIPlus.git directly or by using GIT.
 
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.

 


Our component libraries come in 3 versions a VCL - Firemonkey version (for Delphi / C++ Builder / RAD Studio 10.3 or higher), an MFC compatible Visual C++ version, and a .NET 4.0 supporting Visual Studio 2005 or higher.
 
The RAD Studio version is a set of native VCL and Firemonkey components of which all include now the powerful Mitov Runtime.
 
The Visual C++ version is a set of native Visual C++ classes (components).
 
The NET 4.0 (4.5 and higher compatible) version is a set of managed .NET components.  The .NET version has the same performance as the native versions, and supports all the Microsoft .NET languages including Visual Basic, C#, J#, F# and C++/CLI.
 
Due to the unique architecture of the OpenWire platform, the components are implemented the same way in Managed .NET and native Windows (32 and 64 bit) environments. The code to control a component from VB.NET, C++/CLI, C#, and J#, Visual C++ MFC, Delphi, and C++ Builder is almost identical. This allows the developers to migrate and share code between the different environments thus significantly improving the productivity.
 
OpenWire Libraries: for fast, complex data stream processing with almost zero lines of code!

 

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.

 

IGDI+: What's New

New in Version 8.0.0.108 (released on 2024-02-21)

  • Improved Delphi 12 support

New in Version 8.0.0.101 (released on 2023-12-06)

  • Added Delphi 12 support

New in Version 8.0.0. 36 (released on 2021-10-11)

  • Added RAD Studio 11 support

New in Version 8.0.0. 27 (released on 2021-06-20)

  • Added RAD Studio 10.4 Sydney support

New in Version 8.0.0. 0 (released on 2020-11-26)

  • Improved IGDIPlus rendering performance
  • Modified to use interface class function methods instead of constructors
  • Added initial CrossVCL support

New in Version 7.8.2.271 (released on 2018-11-12)

  • Added Delphi 10.2 Tokyo support
  • Added support for rectangle intersecting check
  • Added GPMakeGrayScaleColor
  • Added HexToUInt

New in Version 7.6.0.0 (released on 2015-04-18)

  • Added XE8 support
  • Added Save inage to TStream
  • Added Create image from TStream
  • Added Image to TBytes
  • Added Create image from TBytes

     

New in Version 7.5.0.0 (released on 2014-11-18)

  • Added XE7 support
     

New in Version 7.0.0.0 (released on 2014-04-21)

  • Added XE5 and XE6 support
  • Simplified image bits access
  • Improved FireMonkey compatibility
  • Updated to use the new Delphi TPointF record

New in Version 6.0 (released on 2013-06-12)

  • Added XE4 support
  • New mechanism for locking and accessing pixels in bitmaps trough IGPBitmapData locking object with automatic unlocking
  • Improved performance with inlining
  • Added new transforms
  • Expanded MeasureCharacterRanges
  • Discontinued support for anything older than Delphi 2009

New in Version 5.0.3 (released on 2012-10-10)

 

  • Added support for Delphi / C++ Builder / RAD Studio XE3
  • Improved Bitmap Data
  • Improved Warp
  • Enhanced MeasureCharacterRangesF

New in Version 5.0.2 (released on 2012-04-16)

 

  • Added 64 bit support.
  • Improved FireMonkey compatibility.
  • Added the option to include the unit using a different name to allow multiple instances to be loaded in packages.

New in Version 5.0 (released on 2011-09-12)

  • Added Delphi XE and XE2 support.
  • Added FireMonkey compatibility.
  • Some small changes and few new functions added in the IGPGraphics.
  • Added the option to easily save and restore the transformations.

New in Version 2.2

  • Minor improvements.

New in Version 2.1

  • Minor improvements.

New in Version 2.0

  • Added Delphi 2010 support.
  • Number of small improvements.

New in Version 1.0

  • This is the first official IGDI+ release.
( Click to view Larger images. )
These demos are executable after downloading.
Also see:   Demo source code downloads

IGDI+ Examples

IGDI+ Example IGDI+ Example

IGDI+: Frequently Asked Questions

Q: Can I use IGDI+ in a non open source commercial application or component library?
A:
Yes you can use IGDI+ in non open source applications and component libraries.

IGDI+ Installers

Firemonkey and VCL Installer: IGDI+ 8.0.0.108 VCL and FireMonkey 32 & 64 bit support for 10.3 Rio to 12.0 Athens
Updated on 2024-02-21, downloaded 3757 times.


Demos

These demos are executable after downloading.   Also see: Demo source code downloads

 

             This software is provided 'as-is', without any express or
             implied warranty.  In no event will the author be held liable
             for any  damages arising from the use of this software.
 
             Permission is granted to anyone to use this software for any
             purpose, including commercial applications, and to alter it
             and redistribute it freely, subject to the following
             restrictions:
 
             1. The origin of this software must not be misrepresented,
                you must not claim that you wrote the original software.
                If you use this software in a product, an acknowledgment
                in the product documentation would be appreciated but is
                not required.
 
             2. Altered source versions must be plainly marked as such, and
                must not be misrepresented as being the original software.
 
             3. This notice may not be removed or altered from any source
                distribution.

News

February 21, 2024more...

NEW RELEASE: Updated RAD Studio/Delphi 12.0.0 Athens version of all the libraries has been released!

December 21, 2023more...

UPDATED: BMDThread Delphi components

December 6, 2023more...

NEW RELEASE: RAD Studio/Delphi 12.0.0 Athens version of all the libraries has been released!

March 9, 2022more...

NEW RELEASE: Updated RAD Studio/Delphi 10.4 Sydney version of all the libraries has been released!

March 7, 2022more...

NEW RELEASE: Updated RAD Studio/Delphi 10.3 Rio version of all the libraries has been released!

March 2, 2022more...

NEW RELEASE: Updated RAD Studio/Delphi 11.0 Alexandria version of all the libraries has been released!

January 28, 2022more...

NEW RELEASE: Updated RAD Studio/Delphi 10.4.2 Sydney version of all the libraries has been released!

January 28, 2022more...

NEW! OpenWire Studio version Beta 8.0.0.48 is released.

December 21, 2021more...

NEW RELEASE: Updated RAD Studio/Delphi 11.0.0 Alexandria version of all the libraries has been released!

October 11, 2021more...

NEW RELEASE: RAD Studio/Delphi 11.0 Alexandria version of all the libraries has been released!

May 12, 2021more...

NEW RELEASE: RAD Studio/Delphi 10.4.2 Sydney version of all the libraries has been released!


More News

Partners

Em
Alliancelogo2

Published

Torry_logo