VS:CreateImageFromPaint

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Creates an image resource from a paint node.

FUNCTION CreateImageFromPaint(
paint :HANDLE;
imageName :STRING) : HANDLE;
def vs.CreateImageFromPaint(paint, imageName):
    return HANDLE

Parameters

paint HANDLE Handle to the paint node to be used to create the image resource.
imageName STRING User-specified name to be used to identify the newly created image resource.

Return Value

Returns the handle to the newly create image resource if successful; nil otherwise.

Example

PROCEDURE Example;
VAR
	hImage  : HANDLE;
	copyImage : HANDLE;
	paintHandle : HANDLE;
	importPt  : POINT;
BEGIN
	GetPt(importPt.x, importPt.y);
	hImage := ImportImageFile('D:\\Lenna.png', importPt.x, importPt.y );
	paintHandle := CreatePaintFromImage(hImage);
	copyImage := CreateImageFromPaint(paintHandle, 'Copy Image');
END;
RUN(Example);

Python

def Example():	
	hImage = vs.ImportImageFile('D:\\Lenna.png', 10, 10 )
	paintHandle = vs.CreatePaintFromImage(hImage)
	copyImage = vs.CreateImageFromPaint(paintHandle , 'Copy Image')

Example()

Version

Availability: from VectorWorks10.0