VS:CreatePaintFromImage

From Vectorworks Developer
Jump to navigation Jump to search

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

Description

Creates a paint node from an image resource.

FUNCTION CreatePaintFromImage(
image :HANDLE) : HANDLE;
def vs.CreatePaintFromImage(image):
    return HANDLE

Parameters

image HANDLE Handle to the image resource from which a paint node is to be created.

Return Value

Returns the handle to the newly created paint node.

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