TAdvShaper is a visual VCL component from TMS Software (part of the TMS VCL UI Pack) designed to instantly transform any standard Windows Form or control into a complex, custom 2D geometric shape. Instead of forcing developers to write tedious, mathematical GDI/GDI+ Win32 API rendering code, it utilizes a fast bitmap-masking algorithm to reshape UI elements using an existing image. Core Mechanism: How It Works
TAdvShaper works by loading a source bitmap and evaluating a user-defined mask color.
Every pixel matching the mask color is treated as transparent and stripped away.
All other pixels define the permanent, visible bounds of your custom user interface component. Step-by-Step Design Workflow
Designing a custom component with TAdvShaper is built directly into the Delphi or C++Builder IDE: 1. Prepare Your Source Graphic
Create an image using a graphic editor (like Photoshop, Illustrator, or Canva).
Draw the exact outline you want your UI component to take (e.g., a star, a circular dashboard, a game controller template, or a gear).
Fill the unused exterior area with a single solid color (such as bright magenta 255, 0, 255 or neon green) to serve as your mask color. Save the file as a standard Windows Bitmap (.BMP). 2. Configure the Component in Delphi/C++Builder Open your project and locate the component palette. Drop a TAdvShaper component onto your Target Form.
Use the Object Inspector to set up the following core properties: Action / Setting Picture Load your prepared custom .bmp file. MaskColor Select or enter the exact background color to be cut away. Target
Link this property to the Win32 control or Form you want to reshape. 3. Execution & Fast Masking
Once properties are linked, the component triggers its internal masking routines. It loops through the bitmap, generates a native Windows Region (HRGN), and applies it using the SetWindowRgn API. The target form instantly inherits the exact shape of your artwork, leaving the transparent regions completely click-through to the Windows desktop behind it. Important Design Considerations
Edge Anti-Aliasing: Because TAdvShaper relies on strict binary color masking (a pixel is either 100% visible or 100% masked), avoid using soft, blurry, or anti-aliased edges on your mask boundaries. Jagged blending pixels will fail to match the strict MaskColor, leaving a pixelated outline halo around your component. Stick to crisp, hard aliased graphics.
Component Placement: When putting buttons, text boxes, or labels inside a reshaped form, make sure they sit entirely within the visible boundary lines of your source image. Anything sitting inside the masked zone will be invisible and unclickable.
Dragging and Closing Shapes: Because standard Windows Title Bars are hidden when you heavily reshape a form, you must implement your own custom movement. You can handle the form’s OnMouseDown event and send a WM_SYSCOMMAND message with SC_MOVE to allow users to click and drag your custom component anywhere on their screen.
If you are currently setting up a design, let me know what specific shape you are trying to build or if you need the exact code snippet for dragging borderless forms. TAdvShaper Turns your forms into the shape of a bitmap
Feature overviewEasy to use component that turns any form into the shape of a complex shaped bitmap with very fast algorithm. * www.tmssoftware.com TAdvShaper Turns your forms into the shape of a bitmap
Leave a Reply