Examples

There are a few examples included with the library, which you should be able to find in the Examples subdirectory.

Here is the list of examples with short descriptions:

AntiAliasing Example

Directory: Drawing\AntiAliasing

An example based on the AntiAliasing invariance test to demonstrate the anti aliasing of the renderer

ArrowHead Example

Directory: Drawing\ArrowHead

ByteMaps Example

Directory: General\ByteMaps

A basic demonstration of mapping a 2D array of values to TByteMap and displaying it using TPalette32.

Clipper Example

Directory: Drawing\Clipper

Example to demonstrate boolean clipping (intersection, union, difference and xor) on polygons in 2D space

CubicSpline Example

Directory: Drawing\CubicSpline

A basic demonstration on how custom shaped 2D curves can be drawn

Curves Example

Directory: Drawing\Curves

Former VPR Example, which visualizes the interpolation points of

GammaCorrection Example

Directory: Drawing\GammaCorrection

Based on an Anti-Grain Geometry Example, you can see how gamma correction affects anti-aliasing

GradFills Example

Directory: Drawing\GradFills

An example on using gradient polygon filler.

GradLines Example

Directory: Drawing\GradLines

An example on using line patterns to draw gradient lines.

GradSampler Example

Directory: Drawing\GradSampler

An example on using gradient samplers to draw backgrounds and fill polygons.

Image Warping Example

Directory: Transformation\ImgWarping

This comprehensive example demonstrates extensive use of TRemapTransformation and TVectorMap. It also implements a useful generic brush weight system, which can be applied to other aspects of image related editing (painting, uniform feathering etc.).

Image32 Example

Directory: General\Image32

This example demonstrates the properties of TImage32 that control the scale and alignment of the bitmap image.

ImgView and Layers Example

Directory: Layers\ImgView_Layers

A demonstration of using TImgView32, TPositionedLayer, TBitmapLayer and TRubberbandLayer. It also shows how it is possible to load RGB and Alpha channels from different image files into the TBitmap32 object at run-time and demonstrates an application of affine transformations. It also shows how is it possible to 'flatten' layers.

LineStippling Example

Directory: Drawing\LineStippling

An example on using line patterns to draw dashed lines. 

MeshGradients Example

Directory: Drawing\MeshGradients

Example to demonstrate different sparse point gradient interpolators (also known as mesh gradients)

Nested Sampling Example

Directory: Resampling\NestedSampling

An extensive example that features a visual editor for editing and ordering nested samplers. It demonstrates how different samplers can be combined in order to create dynamically linked sampling chains.

Additionally it shows how various rasterizers affect the rendering process.

PixelF Example

Directory: Resampling\PixelF

A demonstration of interpolated PixelF property. It lets you compare the result with normal pixel access.

PixelCombine Example

Directory: Blending\PixelCombine

A short demonstration of using the OnPixelCombine method in TCustomBitmap32.

ProgressBar Example

Directory: General\ProgressBar

A simple visual component, that demonstrates how is it possible to create custom components based on TCustomPaintBox32. Note, that this component is mostly designed for demonstration purposes, do not expect too much from it.

Polygons Example

Directory: Drawing\Polygons

This example shows the application of TPolygon32 to draw thick lines and other polygons with thick outlines.

RenderText Example

Directory: Drawing\RenderText

A basic demonstration of using the TBitmap32.RenderText method.

Resamplers and Kernels Example

Directory: Resampling\Resamplers

An informative demonstration of the different resamplers and kernels available in Graphics32.

Rotate Example

Directory: General\Rotate

A simple example on using TAffineTransformation. It shows how to rotate and scale the bitmap at the same time so that it stays within the specified rectange.

RotLayer Example

Directory: Layers\RotLayer

Features custom layer class creation and demonsrtates TAffineTransformation.

ScatterPlot Example

Directory: Drawing\ScatterPlot

This example demonstrates how GR32 can be used in different scatter plot apllications. Based on an example from Anti-Grain Geometry

Sprites Example

Directory: Layers\Sprites

A demonstration on adding, removing and animating multiple TBitmapLayer objects to TImage32.

Texture Blend Example

Directory: Blending\TextureBlend

A short demonstration of using the BlendTransfer routine and how to use custom color algebra routines.

Transform Example

Directory: Transformation\Transform

An example, which demonstrates using the Transformation routine together with TAffineTransformation and TProjectiveTransformation.

Visualization Example

Directory: Transformation\Visualization

Implements a simple set of movement (displacement transformations) renderings in line with visualizations found in various audioplayers. The formula style roughly follows conventions of Winamp Visualization Studio, and is buffered using TVectorMap. Different types of pixelrenderings (spots, particles and more) is used to visualize the movements.

See Also

Line Patterns, Bitmap Image, TBitmap32, TBitmap32.RenderText, TCustomBitmap32.OnPixelCombine, TCustomBitmap32.Pixel, Color Types, TImage32, TImgView32, TBitmapLayer, TPositionedLayer, TRubberbandLayer, TByteMap, TPolygon32, BlendTransfer, TAffineTransformation, TProjectiveTransformation, TRemapTransformation, Transform, TVectorMap