

Windows uses GDI for most drawing, and GDI was never intended for something as complex as partial transparency or composition. Per-pixel alpha, premultiplied alpha, and advanced blendingĪ quick introduction to partial transparency.Using this to create an Explorer-style transparent selection.Using constant alpha (transparency) across an image, and blending it over another image.

#TRANSPARENT RECTANGLE SERIES#
By the end of the series I will have introduced a small alpha-aware canvas class that you can use to draw standard shapes (rectangles, ellipses, etc) just as you can with the normal TCanvas (and using standard TFont, TPen and TBrush objects), to compose several layers of alpha blended graphics together, and to draw on glass on Vista and Windows 7. This is part 1 of a short series that examines alpha-aware graphics using native GDI only – not GDI+, not DirectX, and not with any other custom non-GDI graphics implementation.

How do you achieve all of these with Delphi or C++Builder? Custom drawing on glass, such as text with the blurred white background and custom controls.Text with a transparent shape behind it, so you can see the through to the background and still clearly read the text.Selections with transparent rectangles or other shapes.Half the UIs you will have used today will have made some use of composited graphics, overlays, or something similar. Transparent graphics are used everywhere these days.
