Copyright © 2002-2009 MultiMedia Soft 
Return to index  
How to customize the 3D rendering of custom shaped buttons 
3D Button API comes with several kinds of 3D rendering but, in some case, there could be the need to render the buttons using a more sophisticated 3D approach, so there is the possibility to provide a custom 3D rendering using bitmaps created with specific graphical applications like Adobe PhotoShop™ or others: the strength of this kind of approach is the fact that you will have the possibility to provide the Caption text with your preferred settings at both design-time and runtime
Before proceeding with this tutorial, in order to fully understand this section, we suggest to take a look to the section  "How to create a custom shaped button". 
Now, suppose you need to have a button that must have the following 3D rendering in Normal state: 
(Picture #1) 
and the following 3D rendering when the mouse is over the button (or when the button is pressed): 
(Picture #2) 
As you may know, starting from version 2 of the SDK, custom shaped buttons can be created using also color bitmaps, so we can use the first picture as a mask for creating our custom shaped button: when you create a mask, you must keep in mind that the color of the bitmap left top pixel will be managed as "transparent", so we must be sure that this color will not be present inside the part of bitmap that will be used to determine the button shape. 
Inside the previous pictures the pure yellow color is not present, so we can apply the yellow color to the bitmap portion that will be considered as "transparent": this task can be easily performed using a simple graphical application like Microsoft Paint. 
(Picture #3) 
Now we have all the elements needed to create our custom shaped button 
  • Set the Shape property to Custom (5).  
  • Set the PictureCustom property to Picture #3.  
  • Set the Picture property to Picture #1.  
  • Set the PictureMouseOver property to Picture #2. 
  • Set the MovePictureOnPress property to FALSE.  
  • That's all. 
    Copyright © 2002-2009 MultiMedia Soft 
    Return to index