TGraph Struct Reference

Inheritance diagram for TGraph

Inheritance graph


Public Methods

void TGraph_draw_rect (struct TGraph *ptr_graph, int x, int y, int w, int h)
void TGraph_draw_rect_Ex (struct TGraph *ptr_graph, struct rect_t *rc)
void TGraph_fill_rect (struct TGraph *ptr_graph, int x, int y, int w, int h)
void TGraph_fill_rect_Ex (struct TGraph *ptr_graph, struct rect_t *rc)
color_t TGraph_get_color (struct TGraph *ptr_graph)
drawmode_t TGraph_get_draw_mode (struct TGraph *ptr_graph)
void TGraph_set_draw_mode (struct TGraph *ptr_graph, drawmode_t mode)
void TGraph_draw_hline (struct TGraph *ptr_graph, int x, int y, int dx)
void TGraph_draw_vline (struct TGraph *ptr_graph, int x, int y, int dy)
void TGraph_draw_line (struct TGraph *ptr_graph, int x1, int y1, int x2, int y2)
void TGraph_fill_screen (struct TGraph *ptr_graph, color_t fc)
void TGraph_get_clip (struct TGraph *ptr_graph, struct rect_t *rc)
color_t TGraph_get_pixel (struct TGraph *ptr_graph, int x, int y)
void TGraph_put_background (struct TGraph *ptr_graph, char *ptr_background)
char* TGraph_get_buf_addr (struct TGraph *ptr_graph)
int TGraph_get_bytes_total (struct TGraph *ptr_graph)
void TGraph_scroll (struct TGraph *ptr_graph, int left, int top, int width, int height, int dx, int dy)
void TGraph_set_bkcolor (struct TGraph *ptr_graph, color_t color)
void TGraph_set_clip (struct TGraph *ptr_graph, int x, int y, int width, int height)
void TGraph_set_clip_Ex (struct TGraph *ptr_graph, struct rect_t *rc)
void TGraph_set_color (struct TGraph *ptr_graph, color_t color)
void TGraph_set_pixel (struct TGraph *ptr_graph, int x, int y, color_t color)


Detailed Description

The TGraph structure is implemented by raster and 2D-graphics. It is designated for working with graphic primitives like rectangles, lines and pixels. It functions similarly to many other SDK structures, in that you must use a TGraph constructor to create the TGraph object, and release it after use with a TGraph deconstructor.

The structure diagram below shows that TGraph is a parent structure for other structures such as Graphics and DisplayGraphics. This means that raster and 2D-graphics operations for Graphics and DisplayGraphics structures are implemented in their parent structure.

To use all TGraph functions you must obtain the Display Graphics Context from the init_module function. It has only one parameter, called the main application module parameter, and it must be obtained by the module_t structure.

See examples for related functions.

See also:
Drawing Primitives and Screen Manipulation


Member Function Documentation

void TGraph_draw_hline ( struct TGraph * ptr_graph,
int x,
int y,
int dx )
 

Draws a horizontal line from point ( x , y ) to point ( dx , y ).

Parameters:
ptr_graph   A pointer to the graphics context
x   x-coordinate of the horizontal line's starting point
y   y-coordinate of the horizontal line's starting point
dx   x-coordinate of the horizontal line's finishing point
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
     if ( TGraph_get_color( main_module.m_gfx ) != CLR_LTGRAY )
        TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     TGraph_draw_hline( main_module.m_gfx, 10, 10, 20);
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_draw_line, TGraph_draw_vline.

void TGraph_draw_line ( struct TGraph * ptr_graph,
int x1,
int y1,
int x2,
int y2 )
 

Draws a solid line from point ( x1 , y1 ) to point ( x2 , y2 ).

Parameters:
ptr_graph   A pointer to the graphic context
x1   x-coordinate of the line's starting point
y1   y-coordinate of the line's starting point
x2   x-coordinate of the line's finishing point
y2   y-coordinate of the line's finishing point
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY or CLR_BLACK.
     if ( TGraph_get_color( main_module.m_gfx ) != CLR_LTGRAY )
        TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     TGraph_draw_line( main_module.m_gfx, 10, 10, 20, 60 );
     ...
     // To send the current graphics page to the TGraph_draw_rect_Ex Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_draw_hline, TGraph_draw_vline.

void TGraph_draw_rect ( struct TGraph * ptr_graph,
int x,
int y,
int w,
int h )
 

Draws a rectangular frame.

Parameters:
ptr_graph   A pointer to a TGraph object
x   The rectangle's left coordinate
y   The rectangle's top coordinate
w   The rectangle's width
h   The rectangle's height
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to Cybiko graphics context
      TGraph_draw_rect( main_module.m_gfx, 10, 10, 100, 100 );
     ...
     // To send the current graphics page to Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_draw_rect_Ex.

void TGraph_draw_rect_Ex ( struct TGraph * ptr_graph,
struct rect_t * rc )
 

The extended version of the TGraph_draw_rect function.
Draws a rectangular frame using the info contained in a rect_t object.

Parameters:
ptr_graph   A pointer to a TGraph object
rc   A pointer to a tect_t object
Returns:
None
   #include <cybiko.h>
     ...
     struct rect_t rc;
     struct module_t main_module;
     init_module( &main_module );
     rc.y = rc.x = 10;
     rc.w = rc.h = 100;
     ...
     // main_module.m_gfx is a pointer to Cybiko graphics context
      TGraph_draw_rect_Ex( main_module.m_gfx, &rc );
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_draw_rect.

void TGraph_draw_vline ( struct TGraph * ptr_graph,
int x,
int y,
int dy )
 

Draws vertical line from point ( x , y ) to point ( x , dy ).

Parameters:
ptr_graph   A pointer to the graphic context
x   x-coordinate of the vertical line's starting point
y   y-coordinate of the vertical line's starting point
dy   y-coordinate of the vertical line's finishing point
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one from following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
     if ( TGraph_get_color( main_module.m_gfx ) != CLR_LTGRAY )
        TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     TGraph_draw_vline( main_module.m_gfx, 10, 10, 20);
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_draw_line, TGraph_draw_hline.

void TGraph_fill_rect ( struct TGraph * ptr_graph,
int x,
int y,
int w,
int h )
 

Fills a rectangle at the specified coordinates with the current color.

Parameters:
ptr_graph   A pointer to a TGraph object
x   The rectangle's left coordinate
y   The rectangle's top coordinate
w   The rectangle's width
h   The rectangle's height
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
      TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     TGraph_fill_rect( main_module.m_gfx, 5, 5, 30, 30 );
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_fill_rect_Ex.

void TGraph_fill_rect_Ex ( struct TGraph * ptr_graph,
struct rect_t * rc )
 

The extended version of the TGraph_fill_rect function.
Fills a rectangle at the specified coordinates with the current color.

Parameters:
ptr_graph   A pointer to a TGraph object
rc   A pointer to a tect_t object
Returns:
None
   #include <cybiko.h>
     ...
     struct rect_t rc;
     struct module_t main_module;
     init_module( &main_module );
     rc.y = rc.x = 10;
     rc.w = rc.h = 100;
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
      TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     TGraph_fill_rect_Ex( main_module.m_gfx, &rc );
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_fill_rect.

void TGraph_fill_screen ( struct TGraph * ptr_graph,
color_t fc )
 

Fills the screen with the color 'fc'.

Parameters:
ptr_graph   A pointer to a TGraph object
fc   The color value
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_fill_screen function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
     TGraph_fill_screen( main_module.m_gfx, CLR_BLACK );
     ...
     // To send the current graphisc page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_put_background, CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, CLR_BLACK.

char * TGraph_get_buf_addr ( struct TGraph * ptr_graph )
 

Returns a pointer to an image of a TGraph object's destination.

Parameters:
ptr_graph   A pointer to a TGraph object
Returns:
A pointer to an image of a TGraph object's destination
   #include <cybiko.h>
     ...
     struct module_t main_module;
     struct TGraph   gfx;
     ...
     init_module( &main_module );
     ...
     TGraph_put_background( main_module.m_gfx, TGraph_get_buf_addr( &gfx ) );
     ...

int TGraph_get_bytes_total ( struct TGraph * ptr_graph )
 

Returns the screen buffer size, in bytes.

Parameters:
ptr_graph   A pointer to a TGraph object
Returns:
The screen bufzfer size in bytes
   #include <cybiko.h>
     ...
     struct module_t main_module;
     char*  ptr_display_buffer;
     init_module( &main_module );
     ...
     // Allocating memory for buffer
     ptr_display_buffer = (char* ) malloc( TGraph_get_bytes_total( main_module.m_gfx ) );
     ...
     // Make some graphics operation ( draw a picture, for instance)
     ...
     // Save the screen
     memcpy( ptr_display_buffer, DisplayGraphics_get_page_ptr(main_module.m_gfx, 0), TGraph_get_bytes_total(main_module.m_gfx));
     ...
     // Make another graphics operation
     ...
     // Restore the screen. Works very fast.
     TGraph_put_background( main_module.m_gfx, ptr_display_buffer );
     ...
     // Make another graphics operation
     ...
     // Restore the screen again.
     TGraph_put_background( main_module.m_gfx, ptr_display_buffer );
     ...
     free( ptr_display_buffer );

void TGraph_get_clip ( struct TGraph * ptr_graph,
struct rect_t * rc )
 

Returns the clip region stored in the 'rc' object.

Parameters:
ptr_graph   A pointer to a TGraph object
rc   A pointer to a rect_t object
Returns:
None
   #include <cybiko.h>
       ...
       struct module_t main_module;
       struct rect_t clip_region;
       init_module( &main_module );
       ...
       // main_module.m_gfx is a pointer to the Cybiko graphics context.
       TGraph_get_clip( main_module.m_gfx, &clip_region );
       if ( (clip_region.x != 0) || ( clip_region.y != 0) ||
            ( clip_region.w != SCREEN_WIDTH) ||( clip_region.h != SCREEN_HEIGHT) )
             TGraph_set_clip( main_module.m_gfx, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
       ...
See also:
TGraph_set_clip.

color_t TGraph_get_color ( struct TGraph * ptr_graph )
 

Returns a TGraph object's current color.

Parameters:
ptr_graph   A pointer to a TGraph object
Returns:
The TGraph object's current color
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
     if ( TGraph_get_color( main_module.m_gfx ) != CLR_LTGRAY )
        TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     TGraph_fill_rect( main_module.m_gfx, 5, 5, 30, 30 );
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_set_color, CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, CLR_BLACK.

drawmode_t TGraph_get_draw_mode ( struct TGraph * ptr_graph )
 

Returns the current draw mode of a TGraph object.

Parameters:
ptr_graph   A pointer to a TGraph object
Returns:
The current draw mode of a TGraph object
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
     TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     ...
     // The second parameter in the TGraph_set_draw_mode function is the draw mode value.
     // This value must be one of the following: DM_XOR, DM_OR, or DM_PUT.
     if ( TGraph_get_draw_mode( main_module.m_gfx ) != DM_PUT )
        TGraph_set_draw_mode( main_module.m_gfx, DM_PUT );
     TGraph_fill_rect( main_module.m_gfx, 5, 5, 30, 30 );
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_set_draw_mode, DM_XOR, DM_OR, DM_PUT.

color_t TGraph_get_pixel ( struct TGraph * ptr_graph,
int x,
int y )
 

Returns the color of the pixel at coordinate ( x , y ).

Parameters:
ptr_graph   A pointer to a TGraph object
x   x-coordinate of the required pixel
y   y-coordinate of the required pixel
Returns:
The color of the pixel at coordinate ( x , y )
   #include <cybiko.h>
     ...
     struct module_t main_module;
     struct rect_t clip_region;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     TGraph_get_clip ( main_module.m_gfx, &clip_region );
     if ( TGraph_get_pixel( main_module.m_gfx, 10, 30 ) == CLR_BLACK )
          TGraph_set_pixel( main_module.m_gfx, 10, 30, CLR_WHITE );
     ...
See also:
TGraph_set_pixel, CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, CLR_BLACK.

void TGraph_put_background ( struct TGraph * ptr_graph,
char * ptr_background )
 

Sets an image pointed by ptr_background as a background image.

Parameters:
ptr_graph   A pointer to a TGraph object
ptr_background   A pointer to a background image
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     char*  ptr_display_buffer;
     init_module( &main_module );
     ...
     // Allocating memory for buffer
     ptr_display_buffer = (char* ) malloc( TGraph_get_bytes_total( main_module.m_gfx ) );
     ...
     // Make some graphics operation ( draw a picture, for instance)
     ...
     // Save the screen
     memcpy( ptr_display_buffer, DisplayGraphics_get_page_ptr(main_module.m_gfx, 0), TGraph_get_bytes_total(main_module.m_gfx));
     ...
     // Make another graphics operation
     ...
     // Restore the screen. Works very fast.
     TGraph_put_background( main_module.m_gfx, ptr_display_buffer );
     ...
     // Make another graphics operation
     ...
     // Restore the screen again.
     TGraph_put_background( main_module.m_gfx, ptr_display_buffer );
     ...
     free( ptr_display_buffer );
See also:
TGraph_fill_screen.

void TGraph_scroll ( struct TGraph * ptr_graph,
int left,
int top,
int width,
int height,
int dx,
int dy )
 

Scrolls the rectangle defined by ( x, y, width, height ) parameters.
The scroll values are dx and dy.

Parameters:
ptr_graph   A pointer to a TGraph object
left   x-coordinate of the rectangle to be scrolled
top   y-coordinate of the rectangle to be srolled
width   A width of the rectangle to be scrolled
height   A height of the rectangle to be scrolled
dx   A horizontal shift value
dy   A vertical shift value
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module(&main_module);
     ...
     TGraph_fill_rect( main_module.m_gfx, 10, 10, 20, 40 );
     DisplayGraphics_show( main_module.m_gfx );
     ...
     // Make some graphics operation
     ...
     TGraph_scroll( main_module.m_gfx, 10, 10, 20, 40, 10, 10 );
     DisplayGraphics_show( main_module.m_gfx );
     ...

void TGraph_set_bkcolor ( struct TGraph * ptr_graph,
color_t color )
 

Sets the transparent color as the color defined in the 'color' parameter.

Parameters:
ptr_graph   A pointer to a TGraph object
color   A color value
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     struct Bitmap bmp;
     ...
     init_module( &main_module );
     // Creates a bitmap from the file "root.ico".
     Bitmap_ctor_Ex1( &bmp, "root.ico" );
     ...
     // Set draw mode to mode OR.
     TGraph_set_draw_mode( main_module.m_gfx, DM_OR );
     // Set transparent color to CLR_BLACK
     TGraph_set_bkcolor( main_module.m_gfx, CLR_BLACK );
     // Draw all pixels of the bitmap except pixels with CLR_BLACK color.
     Graphics_draw_bitmap( main_module.m_gfx, &bmp, 30, 40, BM_NORMAL );
     ...
     Bitmap_dtor( &bmp, LEAVE_MEMORY );
     ...
See also:
TGraph_set_color, CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, CLR_BLACK.

void TGraph_set_clip ( struct TGraph * ptr_graph,
int x,
int y,
int width,
int height )
 

Sets the clipping region.

Parameters:
ptr_graph   A pointer to a TGraph object
x   x-coordinate of the clipping region
y   y-coordinate of the clipping region
width   A width of the clipping region
height   A height of the clipping region
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     struct rect_t clip_region;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     TGraph_get_clip ( main_module.m_gfx, &clip_region );
     if( ( clip_region.x != 0 ) || ( clip_region.y != 0 ) ||
         ( clip_region.w != SCREEN_WIDTH ) || ( clip_region.h != SCREEN_HEIGHT ) )
           TGraph_set_clip( main_module.m_gfx, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
     ...
See also:
TGraph_set_clip_Ex.

void TGraph_set_clip_Ex ( struct TGraph * ptr_graph,
struct rect_t * rc )
 

Sets the clipping region.
This is an extended version of the TGraph_set_clip function.

Parameters:
ptr_graph   A pointer to a TGraph object
rc   A pointer to a rect_t object. By this structure we can define the region coordinates
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     struct rect_t clip_region;
     struct rect_t new_clip_reg;
     init_module( &main_module );
     ...
     new_clip_reg.x = 10;
     new_clip_reg.y = 10;
     new_clip_reg.h = 100;
     new_clip_reg.w = 100;
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     TGraph_get_clip ( main_module.m_gfx, &clip_region );
     if( ( clip_region.x != 0 ) || ( clip_region.y != 0 ) ||
         ( clip_region.w != SCREEN_WIDTH) || ( clip_region.h != SCREEN_HEIGHT ) )
           TGraph_set_clip_Ex( main_module.m_gfx, &new_clip_reg );
     ...
See also:
TGraph_set_clip.

void TGraph_set_color ( struct TGraph * ptr_graph,
color_t color )
 

Sets the foreground color.

Parameters:
ptr_graph   A pointer to a TGraph object
color   A pointer to a color_t object
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
     if ( TGraph_get_color( main_module.m_gfx ) != CLR_LTGRAY )
        TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     TGraph_draw_line( main_module.m_gfx, 10, 10, 20, 60 );
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_set_bkcolor, TGraph_get_color, CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.

void TGraph_set_draw_mode ( struct TGraph * ptr_graph,
drawmode_t mode )
 

Sets the current draw mode of a TGraph object.

Parameters:
ptr_graph   A pointer to a TGraph structure
mode   A drawmode_t object
Returns:
None
   #include "cybiko.h"
     ...
     struct module_t main_module;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     // The second parameter in the TGraph_set_color function is the color value.
     // This value must be one of the following: CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, or CLR_BLACK.
     TGraph_set_color( main_module.m_gfx, CLR_LTGRAY );
     ...
     // The second parameter in the TGraph_set_draw_mode function is the draw mode value.
     // This value must be one of the following: DM_XOR, DM_OR, or DM_PUT.
     if ( TGraph_get_draw_mode( main_module.m_gfx ) != DM_PUT )
        TGraph_set_draw_mode( main_module.m_gfx, DM_PUT );
     TGraph_fill_rect( main_module.m_gfx, 5, 5, 30, 30 );
     ...
     // To send the current graphics page to the Cybiko display you should use this function
     DisplayGraphics_show( main_module.m_gfx );
See also:
TGraph_get_draw_mode, DM_XOR, DM_OR, DM_PUT.

void TGraph_set_pixel ( struct TGraph * ptr_graph,
int x,
int y,
color_t color )
 

Sets the color for the pixel at the coordinates ( x, y ).

Parameters:
ptr_graph   A pointer to a TGraph object
x   x-coordinate of the required pixel
y   y-coordinate of the required pixel
color   A pointer to a color_t object
Returns:
None
   #include <cybiko.h>
     ...
     struct module_t main_module;
     struct rect_t clip_region;
     init_module( &main_module );
     ...
     // main_module.m_gfx is a pointer to the Cybiko graphics context.
     TGraph_get_clip ( main_module.m_gfx, &clip_region );
     if ( TGraph_get_pixel( main_module.m_gfx, 10, 30 ) == CLR_BLACK )
          TGraph_set_pixel( main_module.m_gfx, 10, 30, CLR_WHITE );
     ...
See also:
TGraph_get_pixel, CLR_WHITE, CLR_LTGRAY, CLR_DKGRAY, CLR_BLACK.