Copyright © 2003-2023 MultiMedia Soft

ExportBtnImage method

Previous pageReturn to chapter overviewNext page

Remarks

 

Exports the image of the control into a picture file.

 

Syntax

 

[Visual Basic]

Public Function ExportBtnImage(nImage as Ctl3d.ExportImage, strFilename as String, nFormat as Ctl3d.ExportFormat) as Boolean

 

[C#]

public bool ExportBtnImage(Ctl3d.ExportImage nImage, string strFilename, Ctl3d.ExportFormat nFormat);

 

[C++]

public: bool ExportBtnImage(Ctl3d.ExportImage nImage, String* strFilename, Ctl3d.ExportFormat nFormat);

 

 

Parameter

Description

 

 

nImage

Value that identifies the image that must be exported. Supported values are the following:

Enumerated value

Value

Meaning

ExportImage.Normal

0

The image of the button in normal state.

ExportImage.MouseOver

1

The image of the button when the mouse is over its surface.

ExportImage.Pressed

2

The image of the button in pressed state.

ExportImage.Focus

3

The image of the button when it has the input focus.

ExportImage.Disabled

4

The image of the button in disabled state.

strFilename

String representing the name of the file that will receive the image in the specified format.

nFormat

Contains information about the export format: the low-order word (lower 16 bits) of this parameter contains the graphical format while, for certain formats, the high-order word (higher 16 bits) of this parameter contains further options relative to the specific graphical format.

Supported values are the following:

Enumerated value

Value

Meaning

ExportFormat.BMP

0

Windows bitmap (BMP)

ExportFormat.PNG

1

Portable Network Graphics (PNG)

ExportFormat.JPG

2

JPEG (JPG)

The high-order word of this parameter contains the JPEG compression factor whose range can be in the range 0 (Maximum compression, Low Quality) and 100 (Minimum compression, High Quality).

Examples below (in magenta the compression factor's value):

nFormat set to hexadecimal 00500002 will produce a JPEG picture (hex value 0002) with quality 80 (hex value 0050)

nFormat set to hexadecimal 00200002 will produce a smaller JPEG picture (hex value 0002) but with a lower quality 32 (hex value 0050)

ExportFormat.CLIPBOARD

3

The button image is exported into the Clipboard. In this case the strFilename parameter is ignored.

ExportFormat.GIF

4

GIF

The high-order word of this parameter contains the error diffusion flag.

Examples below (in magenta the error diffusion's value):

nFormat set to hexadecimal 00010004 will produce an opaque GIF picture (hex value 0004) with error diffusion available (hex value 0001)

nFormat set to hexadecimal 00000004 will produce an opaque GIF picture (hex value 0004) without error diffusion (hex value 0000)

ExportFormat.GIF_TRANSP

5

Transparent GIF

The high-order word of this parameter contains the error diffusion flag.

Examples below (in magenta the error diffusion's value):

nFormat set to hexadecimal 00010005 will produce a transparent GIF picture (hex value 0005) with error diffusion available (hex value 0001)

nFormat set to hexadecimal 00000005 will produce a transparent GIF picture (hex value 0005) without error diffusion (hex value 0000)

ExportFormat.PNG_TRANSP

6

Transparent PNG

 

 

Return value

 

Value

Meaning

 

 

False

The operation failed

True

The operation was successful