ObjectDCL Banner

PictureBox_PaintPicture Method

Description

This method will paint a picture anywhere on the control. The dialog box must be visible. If you intend to use this method to show a picture of pictures on the the PictureBox, make this call from the OnPaint event of the PictureBox so that the image is shown at the correct time.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.
UpperLeftX
Integer specifying the upper left X-axis coordinate.
UpperLeftY
Integer specifying the upper left Y-axis coordinate.
PictureID
Picture specifying the picture from the project folder.
Enabled
Boolean specifying the overall look of the picture.
UseMask
Boolean specifying whether to use the picture mask for transparency.

Return Values

Returns the following according to the situation:

  • T when successful.
  • Nil if the control is not found or is not visible.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_PictureBox_PaintPicture 
		MyControlReference [as Reference]
		(list 
			(list 
				UpperLeftX [as Integer]
				UpperLeftY [as Integer]
				PictureID [as Picture]
				[Optional] Enabled [as Boolean]
				[Optional] UseMask [as Boolean]) 
			(list 
				UpperLeftX [as Integer]
				UpperLeftY [as Integer]
				PictureID [as Picture]
				[Optional] Enabled [as Boolean]
				[Optional] UseMask [as Boolean]) 
			...
		)
	)

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_PictureBox_PaintPicture
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		(list 
			(list 
				UpperLeftX [as Integer]
				UpperLeftY [as Integer]
				PictureID [as Picture]
				[Optional] Enabled [as Boolean]
				[Optional] UseMask [as Boolean]) 
			(list 
				UpperLeftX [as Integer]
				UpperLeftY [as Integer]
				PictureID [as Picture]
				[Optional] Enabled [as Boolean]
				[Optional] UseMask [as Boolean]) 
			...
		)
	)

Remarks

This function requires that the component is showing. Otherwise it has no effect.

Applies For

PictureBox.

Example

CopyCode imageCopy Code
; Paint the picture
(Odcl_PictureBox_PaintPicture MyProject_MyForm_MyControl
		(list 50 50 102 T Nil))

See Also

PictureBox_LoadPictureFile, PictureBox_StoreImage