Examples

Graphics32

Examples

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

Here is the list of examples with short descriptions:

ByteMaps Example

Directory: General\ByteMaps_Ex (VCL only due to the 3rd party components used)

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

GradLines Example

Directory: Drawing\GradLines_Ex

An example on using line patterns to draw gradient lines.

Image Warping Example

Directory: Transformation\ImgWarping_Ex

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_Ex

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_Ex

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_Ex

An example on using line patterns to draw dashed lines. 

Nested Sampling Example

Directory: Resampling\NestedSampling_Ex (VCL only due to the use of VCL exclusive TSyntheticImage)

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 affects rendering process.

PixelF Example

Directory: Resampling\PixelF_Ex

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

PixelCombine Example

Directory: Blending\PixelCombine_Ex

A short demonstration of using the OnPixelCombine method in TBitmap32.

ProgressBar Example

Directory: General\ProgressBar_Ex

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_Ex

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

RenderText Example

Directory: Drawing\RenderText_Ex

A basic demonstration of using the TBitmap32.RenderText method.

Resamplers Example

Directory: Resampling\Resamplers_Ex

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

Rotate Example

Directory: General\Rotate_Ex

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_Ex

Features custom layer class creation and demonsrtates TAffineTransformation.

Sprites Example

Directory: Layers\Sprites_Ex

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

Texture Blend Example

Directory: Blending\TextureBlend_Ex

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

Transform Example

Directory: Transformation\Transform_Ex

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

Visualization Example

Directory: Transformation\Visualization_Ex

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

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