Navigation:  DPLOTLIB Functions >

DPlot_GetPlotMetrics function

Print this Topic Previous pageReturn to chapter overviewNext page

int DPlot_GetPlotMetrics(int DocNum, DPLOT_PLOTMETRICS *DPM);

Parameters

DocNum

Document index for the document that you want information for (1-32). In practice this will generally (though not necessarily) be the return value of a call to DPlot_Plot.

*DPM

Address of a DPLOT_PLOTMETRICS structure (see below). The size member of this structure should be set by the caller prior to calling this function.

Return Values

-7

Invalid structure address

-6

Invalid document index (should be 1-32)

-5

Failure to initialize DDE. Should never happen, but if it does then rebooting may be necessary.

-2

Could not establish a DDE connection with DPlot. Either DPlot is not open (user might have closed it) or you requested information from a document that does not exist (which might happen, for example, if the user closes the document window).

1

Success.

 

A DPLOT_PLOTMETRICS structure (see below) may be used to, among other things, scale pixel values from the screen or a bitmap to data space. For more information see Using DPLOT_PLOTMETRICS in the description of the DPlot_GetBitmapEx function.

The structure returned by DPlot is for the last rendering of DocNum to the display or a bitmap. This function is useful if you are rendering a graph to a window in your own application rather than DPlot and/or a bitmap by using a SetOutputWindow command with DPlot_Command.

DPLOT_PLOTMETRICS

 

In C:

typedef struct tagDPLOT_PLOTMETRICS

{

    DWORD   size;       // size of this structure; should be set by the caller

    int     hll;        // horizontal and

    int     vll;        //  vertical coordinates of the lower left corner of

                        //  the plot, in pixels

    int     hur;        // horizontal and

    int     vur;        //  vertical coordinates of the upper right corner of

                        //  the plot, in pixels

    float   xlo;        // value of X at the left plot extent

    float   ylo;        // value of Y at the bottom plot extent

    float   xhi;        // value of X at the right plot extent

    float   yhi;        // value of Y at the top plot extent

    float   stretch[3]; // scale factors for X, Y, and Z w/ 3D plots

    float   scale;      // scale factor for projection of 3D points

    float   azimuth;    // view angles for 3D views, radians

    float   elevation;

    float   ylo2;       // Y extents of 2nd Y axis, if any

    float   yhi2;

} DPLOT_PLOTMETRICS

In Visual Basic:

Type DPLOT_PLOTMETRICS

    size As Long          ' size of this structure

    hll As Long           ' horizontal and

    vll As Long           '  vertical coordinates of the lower left corner of

                          '  the plot, in pixels

    hur As Long           ' horizontal and

    vur As Long           '  vertical coordinates of the upper right corner of

                          '  the plot, in pixels

    xlo As Single         ' value of X at the left plot extent

    ylo As Single         ' value of Y at the bottom plot extent

    xhi As Single         ' value of X at the right plot extent

    yhi As Single         ' value of Y at the top plot extent

    stretch(3) As Single  ' scale factors for X, Y, and Z w/ 3D plots

    scale As Single       ' scale factor for projection of 3D points

    azimuth As Single     ' view angles for 3D views, radians

    elevation As Single

    ylo2 As Single        ' Y extents of 2nd Y axis, if any

    yhi2 As Single

End Type

 

 


Page url: http://www.dplot.com/lib/index.htm?dplot_getplotmetrics.htm