Renders (draws) a specified portion of the picture from a source picture.
Object.Render( hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, prcWBounds )
The Render method syntax has the following parts:
|
Name |
Type |
Description |
|
Object |
APicture object |
|
|
hdc |
Val Long |
Handle of the device context on which to render the image. |
|
x |
Val Long |
Horizontal position of image in the hdc. |
|
y |
Val Long |
Vertical position of image in the hdc. |
|
cx |
Val Long |
Horizontal dimension of the destination rectangle. |
|
cy |
Val Long |
Vertical dimension of the destination rectangle. |
|
xSrc |
Val AHiMetric |
Horizontal offset in the source picture. |
|
ySrc |
Val AHiMetric |
Vertical offset in the source picture. |
|
cxSrc |
Val AHiMetric |
Horizontal dimension to copy from the source picture. |
|
cySrc |
Val AHiMetric |
Vertical dimension to copy from the source picture. |
|
prcWBounds |
Var Any |
Pointer to a rectangle containing the position of the destination within a metafile device context, if hdc is a metafile DC. Cannot be NULL in such cases. |
Renders (draws) a specified portion of the picture defined by the offset (xSrc,ySrc) of the source picture and the dimensions to copy (cxSrc,cySrc). This picture is rendered onto the specified device context, positioned at the point (x,y), and scaled to the dimensions (cx,cy). The prcWBounds parameter specifies the position of this rendering if the destination device context is itself a metafile. Such information is necessary to place one metafile in another.
The following statement renders an APicture object with handle hPicture1, starting at 5 horizontal units (defined by AHiMetric) in the target, 20 vertical units in the target, 100 units wide, 75 units high, from the upper leftmost position in the source image, also for 100 units wide, 75 units high, pointing to the prcWBounds1 position:
picPicture1.Render(hPicture1,5,20,100,75,0,0,100,75,prcWBounds1)
! render the picture of a button - (Vertical dimension of the button is in reverse thus a negative sign added)
btn.Picture.Render(From.hDC, 0, 0, 150, 150, 0, btn.Picture.Height, btn.Picture.Width, -btn.Picture.Height, NULL)
hPal, PaintPictrure, LoadPicture, SavePicture, hDC