Rice Lake iRite IDE User Manual

Page 72

Advertising
background image

68

920i

Programming Reference

Example:
G_Graph1 : DisplayImage;

result : Syscode;

begin

result := GraphCreate(1, G_Graph1, Black, Bar);

if result = SysOK then

result :=GraphInit(71,30,60,110,240);

end if;

end;

GraphInit

GraphInit sets the location of the graph on the display.

x_start

and

y_start

values specify the distance, in

pixels, from top left corner of the display at which the top left corner of the graph is shown.

height

and

width

specify the graph size, in pixels. (Full display size is 240 pixels high by 320 pixels wide.)

Method Signature:
function GraphInit (graphic_no : Integer; x_start : Integer; y_start : Integer;
height : Integer; width : Integer) : SysCode;

Parameters:

[in]

graphic_no

Graphic number

[in]

x_start

X-axis starting pixel location

[in]

y_start

Y-axis starting pixel location

[in]

bitmap

Graphic bitmap

[in]

color

Color type

[in]

height

Graphic height

[in]

width

Graphic width

SysCode values returned:

SysInvalidRequest

The DisplayImage specified by

bitmap

does not exist.

SysOutOfRange

Specified parameters exceed display height or width, or are too small to
accommodate the graphic.

SysDeviceError

Internal error

SysOK

The function completed successfully.

Example:
G_Graph1 : DisplayImage;

result : Syscode;

begin

result := GraphCreate(1, G_Graph1, Black, Bar);

if result = SysOK then

result :=GraphInit(71,30,60,110,240);

end if;

end;

GraphPlot

GraphPlot plots the graph previously set up using the GraphCreate, GraphInit, and GraphScale functions. The
graph appears as a histogram: each GraphPlot call places a bar or line at the right edge of the graph, moving
values from previous calls to the left. The width of the bar, in pixels, is specified by

width

parameter. The

maximum width value is 8; larger values are reduced to 8. If the

y_value

is beyond the bounds set by

GraphScale, the bar is plotted to the maximum or minimum value.

Method Signature:
function GraphPlot (graphic_no : Integer; y_value : Real; width : Integer; color :
Color_type) : SysCode;

Parameters:

[in]

graphic_no

Graphic number

[in]

y_value

Pixel height of histogram

[in]

color

Color type

[in]

width

Pixel width of moving bar

Advertising
This manual is related to the following products: