23.11.2012 Views

2 Visual Components Manuals

2 Visual Components Manuals

2 Visual Components Manuals

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VA_GetPaletteColor Retrieving Palette Color<br />

IPC Colors IPC Color Display Palette<br />

SG3 Colors SG3 Black and White Palette<br />

An overview of available colors can be found here.<br />

3.3.8.1 Copying a Rectangular Screen Area − VA_CopyScreenRect<br />

The VA_CopyScreenRect function copies a rectangular screen area (x1, y1, x2, y2) by dx pixels horizontally and<br />

dy pixels vertically.<br />

Note:<br />

This function is only available on VGA displays.<br />

3.3.8.1.1 Parameter<br />

I/O Parameter Type Meaning<br />

IN enable BOOL This function is only executed if enable is TRUE.<br />

IN VCHandle UDINT The handle returned by VA_Setup.<br />

IN x1/y1 UINT Coordinates of the upper left corner of the rectangle<br />

IN x2/y2 UINT The width and height of the rectangle to be copied<br />

IN dx/dy INT Number of pixels in the X and Y directions in which the rectangle should be copied.<br />

OUT Return Value UINT Not equal to 0 if error occurs<br />

3.3.8.1.2 Example for Automation Basic<br />

(* cyclic program *)<br />

x1 = 100<br />

y1 = 150<br />

x2 = 250<br />

y2 = 150<br />

dx = 10<br />

dy = 10<br />

if ready 1 then<br />

VC_HANDLE = VA_Setup(1 "vga") ,<br />

VC_HANDLE if 0 then<br />

ready = 1<br />

endif<br />

endif<br />

if ready = 1 then<br />

VA_Saccess(1,VC_HANDLE)= if<br />

0 then<br />

VA_CopyScreenRect (1,VC_HANDLE,x1,y1,<br />

width,height,dx,dy)<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

endif<br />

3.3.8.1.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

unsigned long VC_HANDLE;<br />

UINT _GLOBAL x1;<br />

UINT _GLOBAL width;<br />

UINT _GLOBAL y1;<br />

UINT _GLOBAL height;<br />

SINT _GLOBAL dx;<br />

SINT _GLOBAL dy;<br />

_CYCLIC void Cyclic (void)<br />

{<br />

Introduction to <strong>Visual</strong> <strong>Components</strong> 2.3<br />

136 3.3.8.1 Copying a Rectangular Screen Area − VA_CopyScreenRect

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!