Skip to content
Projets

À propos

Delphi friendly interface based GDI+ library.

Outils de développement

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

IGDI-

Delphi friendly interface based GDI+ library.

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:

IGDI+ Demo

... you write code like this:

procedure TForm1.FormPaint(Sender: TObject);
begin
  var AGraphics := TIGPGraphics.Make( Canvas );
  AGraphics.SmoothingMode := TIGPSmoothingMode.AntiAlias;
  AGraphics.TextRenderingHint := TIGPTextRenderingHint.AntiAlias;

  var ALeftTopCorner := TPointF.Create( 20, 20 );
  var AFont := TIGPFont.Make( '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.Make( TIGPLinearGradientBrush.Make( ARect1.Inflate( 2, 2 ), aclRed, aclBlue, TIGPLinearGradientMode.Vertical ), 4 ),
              TIGPPathGradientBrush.Make(
                  TIGPGraphicsPath.Make().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.Make( MakeARGBColor( 50, aclBlack )) )

           .DrawStringF( 'Welcome to IGDI+',
                        AFont,
                        ALeftTopCorner,
                        TIGPLinearGradientBrush.Make( ARect, aclRed, aclBlue, TIGPLinearGradientMode.ForwardDiagonal ));


  // Draw a closed curve.
  AGraphics.DrawClosedCurveF( TIGPPen.Make( aclRed, 3 ), TIGPSolidBrush.Make( 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.Make();
  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.Make( 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.Make( aclRed, 3 ),
              TIGPLinearGradientBrush.Make( TPointF.Create( 0, 0 ), TPointF.Create( 20, 20 ), aclYellow, aclGreen )
              .SetWrapMode( TIGPWrapMode.TileFlipX ),
              0, 0, 200, 80 );

end;

Explorer des projets similaires

Chargement…