Visit Gigasoft's Web Site
 ProEssentials v9 Help


BOOL PEresetimage (hObject, nXAspect, nYAspect )




The handle returned from PEcreate.



Width in pixels, if zero, use control's current width.



Height in pixels, if zero, use control's current height.


This function is called to reset the image when the objects properties are adjusted. This function is normally called after PEreinitialize in the sequence:


PEreinitialize( hPE )

PEresetimage( hPE, 0, 0)

InvalidateRect // Windows API


Or, another scenario, it is used like...


PEreinitialize ( hPE )

// Read ManualMaxY, or other properties related to your logic,
// and possibly add/adjust annotations or settings with

// respect to ManualMaxY for example.

PEresetimage ( hPE, 0, 0 )

InvalidateRect // Windows API


The above code allows you to interogate properties related to data/scales and update properties with respect to these readings without causing an additional image to be generated (which can be a lengthy process for larger data sets.)



NonZero if the function was successful, otherwise Zero.



Another potential scenario where you will call this function is prior to calling PEgetmeta. This allows you to build a metafile with a desired aspect ratio in preparation to sending to a device context. In this case, the aspect ratio used with PEresetimage should be the same as used with the SetViewportExt Windows function. For PEgetmeta and printing information, look to Question 21 in Chapter 7. Though, PEresetimageEx is more commonly used with printing logic.


See Also: PEresetimageEx, PEreinitialize


.NET developers, see PeFunction.ResetImage or PeFunction.ReinitializeResetImage


Ocx|Vcl developers, see the PEactions property.


With OCX interface, you can call this function as follows...

Pego1.PEactions = 2 'calls PEresetimage


In Delphi, use...

PEGraph1.PEactions := gResetImage; {calls PEresetimage}