RenderPicture

<< Click to Display Table of Contents >>

Navigation:  Rendering >

RenderPicture

Previous pageReturn to chapter overviewNext page

Computes the dimensions of a given image, based on the method Picture(). The dimensions are computed including the surrounding frame, if PenSize is <> 0.

If the property PictureCache is true, the rendered image will automatically be stored in the image cache. We recommend to set PictureCache = true always.

method void VPE.RenderPicture(

VpeCoord Width,

VpeCoord Height,

string FileName

)

VpeCoord Width, Height

Can be used to compute either the width or the height by setting one value to a numeric value whilst using VFREE for the other value. Usually you will set both values to VFREE.

string FileName

the image file to be rendered

Remarks:

In case of an error, LastError is set.

 

The computed dimensions can be retrieved with the properties:

nRenderWidth and nRenderHeight

Example:

ActiveX / VCL:

Doc.PictureCache = True

Doc.RenderPicture(VFREE, VFREE, "image.bmp")

xsize = Doc.nRenderWidth

ysize = Doc.nRenderHeight

 

.NET:

Doc.PictureCache = True

Doc.RenderPicture(Doc.nFree, Doc.nFree, "image.bmp")

xsize = Doc.nRenderWidth

ysize = Doc.nRenderHeight

Computes the width and height of the image stored in "image.bmp". By setting PictureCache to true, the image will be loaded into the cache, so if you insert the image later into a document, it isn’t loaded from file a second time (assuming, that it isn’t flushed from the cache, because you rendered / inserted many other - or huge - images that needed the cache). PictureCache is by default true when you open a document.

 

ActiveX / VCL:

Doc.PictureKeepAspect = True

Doc.RenderPicture(VFREE, 5, "image.bmp")

xsize = Doc.nRenderWidth

 

.NET:

Doc.PictureKeepAspect = True

Doc.RenderPicture(Doc.nFree, 5, "image.bmp")

xsize = Doc.nRenderWidth

Computes the undistorted width of the image stored in "image.bmp" relative to the given height of 5cm.

 

See also:

"Rendering Objects" in the Programmer's Manual