Functions

Simple Draw API
[Utilities]

Collaboration diagram for Simple Draw API:

Functions

IdrawCanvas * iupdrvDrawCreateCanvas (Ihandle *ih)
void iupdrvDrawKillCanvas (IdrawCanvas *dc)
void iupdrvDrawFlush (IdrawCanvas *dc)
void iupdrvDrawUpdateSize (IdrawCanvas *dc)
void iupdrvDrawGetSize (IdrawCanvas *dc, int *w, int *h)
void iupdrvDrawParentBackground (IdrawCanvas *dc)
void iupdrvDrawLine (IdrawCanvas *dc, int x1, int y1, int x2, int y2, unsigned char r, unsigned char g, unsigned char b, int style)
void iupdrvDrawRectangle (IdrawCanvas *dc, int x1, int y1, int x2, int y2, unsigned char r, unsigned char g, unsigned char b, int style)
void iupdrvDrawArc (IdrawCanvas *dc, int x1, int y1, int x2, int y2, double a1, double a2, unsigned char r, unsigned char g, unsigned char b, int style)
void iupdrvDrawPolygon (IdrawCanvas *dc, int *points, int count, unsigned char r, unsigned char g, unsigned char b, int style)
void iupdrvDrawText (IdrawCanvas *dc, const char *text, int len, int x, int y, unsigned char r, unsigned char g, unsigned char b, const char *font)
void iupdrvDrawImage (IdrawCanvas *dc, const char *name, int make_inactive, int x, int y)
void iupdrvDrawSetClipRect (IdrawCanvas *dc, int x1, int y1, int x2, int y2)
void iupdrvDrawResetClip (IdrawCanvas *dc)
void iupdrvDrawSelectRect (IdrawCanvas *dc, int x1, int y1, int x2, int y2)
void iupdrvDrawFocusRect (IdrawCanvas *dc, int x1, int y1, int x2, int y2)

Detailed Description

See iup_drvdraw.h

Function Documentation

IdrawCanvas* iupdrvDrawCreateCanvas ( Ihandle *  ih  ) 

Creates a draw canvas based on an IupCanvas. This will create an image for offscreen drawing.

void iupdrvDrawKillCanvas ( IdrawCanvas *  dc  ) 

Destroys the IdrawCanvas.

void iupdrvDrawFlush ( IdrawCanvas *  dc  ) 

Draws the ofscreen image on the screen.

void iupdrvDrawUpdateSize ( IdrawCanvas *  dc  ) 

Rebuild the offscreen image if the canvas size has changed. Automatically done in iupdrvDrawCreateCanvas.

void iupdrvDrawGetSize ( IdrawCanvas *  dc,
int *  w,
int *  h 
)

Returns the canvas size available for drawing.

void iupdrvDrawParentBackground ( IdrawCanvas *  dc  ) 

Draws the parent background.

void iupdrvDrawLine ( IdrawCanvas *  dc,
int  x1,
int  y1,
int  x2,
int  y2,
unsigned char  r,
unsigned char  g,
unsigned char  b,
int  style 
)

Draws a line.

void iupdrvDrawRectangle ( IdrawCanvas *  dc,
int  x1,
int  y1,
int  x2,
int  y2,
unsigned char  r,
unsigned char  g,
unsigned char  b,
int  style 
)

Draws a filled/hollow rectangle.

void iupdrvDrawArc ( IdrawCanvas *  dc,
int  x1,
int  y1,
int  x2,
int  y2,
double  a1,
double  a2,
unsigned char  r,
unsigned char  g,
unsigned char  b,
int  style 
)

Draws a filled/hollow arc.

void iupdrvDrawPolygon ( IdrawCanvas *  dc,
int *  points,
int  count,
unsigned char  r,
unsigned char  g,
unsigned char  b,
int  style 
)

Draws a filled/hollow polygon. points are arranged xyxyxy...

void iupdrvDrawText ( IdrawCanvas *  dc,
const char *  text,
int  len,
int  x,
int  y,
unsigned char  r,
unsigned char  g,
unsigned char  b,
const char *  font 
)

Draws a text. x,y is at left,top corner of the text.

void iupdrvDrawImage ( IdrawCanvas *  dc,
const char *  name,
int  make_inactive,
int  x,
int  y 
)

Draws an image. x,y is at left,top corner of the image.

void iupdrvDrawSetClipRect ( IdrawCanvas *  dc,
int  x1,
int  y1,
int  x2,
int  y2 
)

Sets a rectangle clipping area.

void iupdrvDrawResetClip ( IdrawCanvas *  dc  ) 

Removes clipping.

void iupdrvDrawSelectRect ( IdrawCanvas *  dc,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a selection rectangle.

void iupdrvDrawFocusRect ( IdrawCanvas *  dc,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a focus rectangle.