Background Theme

Top  Previous  Next

When the DrawOption wpDrawPageShade and ViewOptionEx wpPaintPageShade is used, a bitmap is used to render the shaded borders of the page. This is done by the utility function WPDrawRectWithBitmap.

 

To use a different bitmap instead of the default one, you can assign it to the global variable WPDrawRectWithBitmap_bitmap.

 

Example: WPDrawRectWithBitmap_bitmap := MetroStyleImage.Picture.Bitmap;

 

The bitmap should show a shaded square. To display a also a shade in focussed state, two squares must be rendered side by side. A good size for one saque is 66*66 pixel since internally it is divided into 9 parts.

 

Example bitmaps for WPDrawRectWithBitmap:

PageBackground_iceberg PageBackground_metro

 

 

New: WPTools 9 includes a resource file with several PNG images which can be used easily.

 

{$R WPShadePNG.RES} // load the resource file

 

// Create a PNG image  // it should be freed at program end.

 

pageshadepng := TPNGImage.Create; // from VCL.imaging.PNGImage

 

pageshadepng.LoadFromResourceName(HInstance, WPDesktopShadingNames[wpDrawDarkGlow]);

 

wptools_9_shading

 

// possible values: wpDrawBlackGlow, wpDrawBlueShade,

// wpDrawDarkGlow, wpDrawDarkShade, wpDrawGreenShade

// wpDrawLightGrayShade, wpDrawMidGrayShade, wpDrawRedShade, wpDrawWhiteShade

 

// Assign the bitmap. If you want to use a different bitmap you need to create

// a new PNG object and assign that to clear the internal cache

 

WPDrawRectWithBitmap_bitmap := pageshadepng;

 

wptools_themed

 

 

Please see the chapter about WPImageList and the creation of icon lists.