DiGrande.it

Blind, Braille and Embossing Technologies

This site uses cookies to personalize content and ads, provide social media features and analyze links. By closing this banner or continuing to browse, you consent to their use.
Read the DiGrande.it Cookie Policy

GraphicSize- Change the size and appearance of the graph

Changes the size and appearance of the graph.

- GraphicSize(W,H[,M])

Parameters:

- (int) W: new width of the graph;

- (int) H: New height of the graph;

- (int) M: Graph sizing mode (optional):

0 resizes the graphics area without altering the graph (default);

1 resizes the graphic area and the image drawn there;

2 changes only the scale values in relation to the system size of the graphics area;

3 Changes only the scaling values in relation to the current graph size.

Description:

Use GraphicSize to set or change the size of the graph or scale factors that affect your drawing. The instruction can be used in any part of the code. Usually used at the beginning to change the starting size of the graph or, more properly, to specify the actual size of the graph in order to reset the scaling factors.

Mode 0 resizes the graphics area without altering the image or scale factors. It is useful to force the dimensions at the beginning or during drawing.

Mode 1 readjusts the image by enlarging it or shrinking it to the new size. This mode has a visible effect only if used when the graph already contains a drawing.

Mode 2 leaves the image size unchanged, but recalculates the scaling factors in relation to the system size of the graph.

Mode 3 leaves the image size unchanged, but recalculates the scaling factors relative to the current size of the graph.

Scale factors can also be forced using the GraphicScale instruction. unlike that instruction, GraphicSize automatically chooses the correct scale value to maintain image proportions.

The Width, Height, ScaleX and ScaleY constants contain the size and scaling factors of the graph.

Examples:

- Draw a full-screen circle, whatever the size of the original graph

GraphicSize(20,20,2)

Circle(10,10,9)