Copyright © 1998-2015 MultiMedia Soft

How to apply a texture to the button surface

Previous pageReturn to chapter overviewNext page

The simplest way to change a button's appearance is to use, inside 3D Button Visual Editor, the Textures tab. At run-time each of these properties can be referenced by name.

Supported texture formats are:

BMP
JPG
PNG

Below you can see a sample of a button with a blue marble texture applied.

3dabm_i000072

Note: The image below has hot links to take you to explanations of the various settings.

3dabm_i00006e

 

Texture management is handled by the TextureSurface property through an internally implemented  COM object called Texture.

 

Item name

Description

Corresponding property


Texture preview

Preview of the loaded texture picture

Texture.Filepath


Mode

The mode used to display a texture over the button surface.

Texture.Mode


Mix with Color

The color that will be mixed to the texture.

Texture.ColorToMix


"Change..." button

This button will open the color choice dialog box

 


"Undefine" button

This button will set the color mixed to the texture to an undefined state: when a color is set to undefined no color mixing is performed.

The undefined state is represented with the 3dabm_i00005a symbol in place of the color.

 


Mix percentage

The mixing percentage between the texture and the chosen color.

Texture.PercentageColorMix


Light intensity percentage

The intensity of the light hitting the texture

Texture.LightIntensity


3dabm_i000013 Browse button

Browses the current PC folders for a texture picture.

 


3dabm_i000015Delete button

Deletes the current texture picture

 

 

At Run-time the texture picture can be changed using the following methods:

SetPictureFromHandle method to change the texture picture using a bitmap loaded in memory, identified by a bitmap handle.

SetPictureFromMemory method to change the texture picture using a bitmap loaded in memory.

SetPictureFromNet method to change the texture picture using a bitmap loaded from the Internet.