Tutorials
Welcome to the Graphics32 Tutorials section! Whether you are completely new to Graphics32 or looking for practical code snippets to perform common graphics tasks, these beginner-friendly guides provide step-by-step explanations and Pascal code snippets to introduce you to the most common usage patterns.
Tutorial Guides
Basic Drawing & Shapes Learn how to instantiate
TBitmap32, clear backgrounds, set bitmap dimensions, draw primitive lines and rectangles, and understand clipping method suffixes (*S,*TS).Alpha Blending & Transparency Explore 32-bit ARGB colors (
TColor32), translucent color constants,DrawModesettings (dmOpaque,dmBlend), combine modes (cmAdd,cmModulate), and globalMasterAlphacontrols.Fast Pixel Access & Direct Manipulation Master high-performance pixel operations using bounds-checked
PixelS, uncheckedPixel, row pointers viaScanLine[Y], and whole-image flat array processing withBits.Image Resampling & High-Quality Scaling Understand nearest-neighbor stretching vs convolution resampling, configuring
TKernelResampler, choosing optimal filter kernels (Lanczos,Mitchell,Bicubic), and using proceduralResamplehelpers.Affine Transformations Learn how
TAffineTransformationmatrices work to rotate bitmaps around custom center points, scale, skew, and translate surfaces, and calculate exact transformed bounding boxes withGetTransformedBounds.Vector Polygons & Path Drawing Discover sub-pixel float coordinates (
TFloatPoint), anti-aliased polygon rendering with VPR (PolygonFS), stroking thick paths with customizable line joins and caps, and multi-contour hole filling.Color Gradients & Fill Samplers Configure gradient color stops with
TColor32Gradient, fill vector polygons withTLinearGradientPolygonFillerandTRadialGradientPolygonFiller, and control gradient repetitions withWrapMode.Working with Interactive Layers in TImage32 Build interactive desktop applications using
TImage32, add positionableTBitmapLayerinstances, enable interactive mouse dragging and resizing handles withTRubberbandLayer, and manage z-order.Loading, Saving & Image Formats Load and save 32-bit images across PNG, JPEG, BMP, and PSD formats from disk and memory streams, preserve alpha channels with
ResetAlpha, and convert pixels between VCL/FCLTBitmapandTBitmap32.Repaint Optimization & Custom Canvas Drawing Optimize rendering performance with
BeginUpdate/EndUpdatebatching, invalidate partial sub-regions usingChanged(TRect), draw non-destructive UI overlays withTImage32.OnPaintStage, and build smooth animation loops.