Functions

Simple Draw API
[Utilities]

Collaboration diagram for Simple Draw API:

Functions

IdrawCanvas * iupDrawCreateCanvas (Ihandle *ih)
void iupDrawKillCanvas (IdrawCanvas *dc)
void iupDrawFlush (IdrawCanvas *dc)
void iupDrawUpdateSize (IdrawCanvas *dc)
void iupDrawGetSize (IdrawCanvas *dc, int *w, int *h)
void iupDrawParentBackground (IdrawCanvas *dc)
void iupDrawLine (IdrawCanvas *dc, int x1, int y1, int x2, int y2, unsigned char r, unsigned char g, unsigned char b, int style)
void iupDrawRectangle (IdrawCanvas *dc, int x1, int y1, int x2, int y2, unsigned char r, unsigned char g, unsigned char b, int style)
void iupDrawRectangleInvert (IdrawCanvas *dc, int x1, int y1, int x2, int y2)
void iupDrawArc (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 iupDrawPolygon (IdrawCanvas *dc, int *points, int count, unsigned char r, unsigned char g, unsigned char b, int style)
void iupDrawText (IdrawCanvas *dc, const char *text, int len, int x, int y, unsigned char r, unsigned char g, unsigned char b, const char *font)
void iupDrawImage (IdrawCanvas *dc, const char *name, int make_inactive, int x, int y, int *img_w, int *img_h)
void iupDrawSetClipRect (IdrawCanvas *dc, int x1, int y1, int x2, int y2)
void iupDrawResetClip (IdrawCanvas *dc)

Detailed Description

See iup_draw.h

Function Documentation

IdrawCanvas* iupDrawCreateCanvas ( Ihandle *  ih  ) 

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

void iupDrawKillCanvas ( IdrawCanvas *  dc  ) 

Destroys the IdrawCanvas.

void iupDrawFlush ( IdrawCanvas *  dc  ) 

Draws the ofscreen image on the screen.

void iupDrawUpdateSize ( IdrawCanvas *  dc  ) 

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

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

Returns the canvas size available for drawing.

void iupDrawParentBackground ( IdrawCanvas *  dc  ) 

Draws the parent background.

void iupDrawLine ( 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 iupDrawRectangle ( 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 iupDrawRectangleInvert ( IdrawCanvas *  dc,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a rectangle inverting the color in the canvas.

void iupDrawArc ( 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 iupDrawPolygon ( 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 iupDrawText ( 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 iupDrawImage ( IdrawCanvas *  dc,
const char *  name,
int  make_inactive,
int  x,
int  y,
int *  img_w,
int *  img_h 
)

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

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

Sets a rectangle clipping area.

void iupDrawResetClip ( IdrawCanvas *  dc  ) 

Removes clipping.