Image32 -
A 2D graphics library for Delphi programmers


Image32 is a compact 2D graphics library written in Delphi Pascal. It provides an extensive range of image manipulation functions. It also includes a polygon renderer for line and polygon drawing. The renderer supports a range of brush filling options including tiled images, and linear and radial gradient fills.

Version: 1.0
Uploaded: 8 July 2019
Freeware for both open source and commercial applications (Boost Software License).
Copyright © 2019 Angus Johnson

Online documentation is here.
Download Library: Image32 Library.

Image processing

A TImage32 has an extensive list of methods to manipulate images including: hue, luminance & saturation adjustment; box blur & Gaussian blur; erase color; blend merge images; crop; emboss; flip & rotation; scaling; sharpen; skew etc.

  uses Image32, Image32_BMP, Image32_PNG;
  ...
  img := TImage32.Create;
  img.LoadFromFile('beetle.bmp');
  img.EraseColor(clAqua32);
  img.SaveToFile('beetle.png');
  img.Free;

  uses Image32, Image32_PNG;
  ...
  img := TImage32.Create;
  img.LoadFromFile('fruit.png');
  img.Sharpen(3, 30);
  img.SaveToFile('fruit_sharpened.png');
  img.Free;

  uses Image32, Image32_PNG, 
    Image32_Extra;
  ...
  img := TImage32.Create;
  img.LoadFromFile('redeye.png');
  RedEyeRemove(img, 
    Rect(59,87,78,106));
  RedEyeRemove(img, 
    Rect(193,99,212,118));
  img.SaveToFile('redeye_fixed.png');
  img.Free;

  uses Image32, Image32_PNG, 
    Image32_Transform;
  ...
  img := TImage32.Create;
  img.LoadFromFile('clouds.png');
  //setup projection, then 
  ProjectiveTransform(img, src, dst);
  img.SaveToFile('clouds_proj.png');
  img.Free;


Polygon Rendering

Image32 also provides numerous drawing tools for line and polygon drawing including support for solid, gradient and image filled lines, dashed lines and polygons. The library also provides numerous functions for vector drawing, including: Rectangle; RoundRect; Ellipse; Pie & Arc; CBezier & QBezier; Star; etc.

      uses Image32, Image32_PNG,
        Image32_vector, Image32_Draw, Image32_Clipper;
      ...
      var
        img: TImage32;
        path: TArrayOfPointD;
        paths: TArrayOfArrayOfPointD;
      begin
        img.SetSize(256,256);
        rec := img.Bounds;
        Windows.InflateRect(rec, -50,-50);

        path := Star(PointD(128, 128), 50, 100, 7);
        //draw the outline
        DrawLine(img, path, 1, clBlack32, esClosed);
        //setup the color gradient
        radGradRend := TRadialGradientRenderer.Create;
        radGradRend.SetParameters(rec, 
		  clFuchsia32, clYellow32);
        //draw the polygon 
        DrawPolygon(img, path, frNonZero, radGradRend);
        //and draw a dashed outline 
        paths := InflatePolygon(path, 7, jsRound);
        DrawDashedLine(img, paths,
          [4,4], 0, 1, clBlack32, esClosed);

        img.SaveToFile('star.png');
        radGradRend.Free;
        img.Free;
      end;


      uses Image32, Image32_PNG, Image32_Text, 
        Image32_Draw, Image32_Extra;
      ...
      var
        img: TImage32;
        startPt, endPt: TPointD;
        paths: TArrayOfArrayOfPointD;
        lf: TLogFont;
        fi: TFontInfo;
      begin
        lf := DefaultLogfont;
        lf.lfFaceName := 'Impact';
        lf.lfHeight := -96;
        fi := GetFontInfo(lf);

        startPt := PointD(20, 130);
        img := TImage32.Create(400,150);
        paths := GetTextOutline(startPt.X, startPt.Y,
          'Image32', fi, taLeft, endPt);
		//Draw a drop shadow
  		DrawShadow(Result, path, frNonZero, 3);
		//outline and fill the text polygons
        DrawLine(img, paths, 1, clBlack32, esClosed);
        DrawPolygon(img, paths, frNonZero, $FF00DD00);
		//add a 3D highlight using default colors
        Draw3D(img, paths, frNonZero, 3,4);

        img.SaveToFile('image32_text.png');
        img.Free;
      end;





BitmapPanels -
Delphi panels turned into powerful image viewers


BitmapPanels provides an incredibly easy way to convert standard TPanel controls into powerful image viewers. You don't even need to install a component. Simply add BitmapPanels to the interface's uses clause in your form's unit, and TPanel controls on that form will automatically become image viewers - if or when images are assigned to their new Bitmap properties.

Version: 1.0
Uploaded: 8 July 2019
Freeware for both open source and commercial applications (Boost Software License).
Copyright © 2019 Angus Johnson

Download: BitmapPanels.



Key features:


BitmapPanels keyboard actions:

assuming the Panel's TabStop property = true
0 (zero)Scales the image to best fit
1..9Scales the image 1 to 9 times normal
[shift] + 1..9Scales the image 0.1 to 0.9 times normal
arrow keysnormal scrolling
[shift] + arrow keysaccelerated (5 times normal) scrolling
[ctrl] + up arrowzoom in
[ctrl] + down arrowzoom out





Back to my Delphi Page « » Back to my Home Page