Painter

Categoryclass
Typehime_painter_t

Graphic context.

Methods

void hime_painter_save(self)

Saves a copy of the drawing state onto a stack, operating on this copy until a balanced call to Restore() is made.

Parameters

Return

void

void hime_painter_restore(self)

Restores the drawing state after a call to Save(). It is an error to call Restore() more times than Save().

Parameters

Return

void

void hime_painter_clip_rect(self, rect, op)

Appliy rect to the current clip using the specified region op.

Parameters

Return

void

void hime_painter_clip_path(self, path, op, anti_alias)

Adds path to the current clip. Set anti_alias to true if the clip should be antialiased.

Parameters

Return

void

void hime_painter_translate(self, offset)

Add translate transformation which moves the origin by offset.

Parameters

Return

void

void hime_painter_scale(self, x_scale, y_scale)

Add scaling transformation to the painter.

Parameters

Return

void

void hime_painter_rotate(self, rotate)

Add rotation transformation to the painter.

Parameters

Return

void

void hime_painter_draw_color(self, color, mode)

Fill the entire canvas' bitmap (restricted to current clip) with specified color and mode.

Parameters

Return

void

void hime_painter_draw_line(self, p1, p2, flags)

Draws a line with the given paint parameters.

Parameters

Return

void

void hime_painter_draw_rect(self, rect, paint)

Draw the given rectangle with the given paint parameters.

Parameters

Return

void

void hime_painter_draw_oval(self, rect, paint)

Draw an oval.

Parameters

Return

void

void hime_painter_draw_round_rect(self, rect, radius, paint)

Draw the given rectangle with rounded corners of radius using the given flags parameters.

Parameters

Return

void

void hime_painter_draw_path(self, path, paint)

Draw the given path using the given paint parameters.

Parameters

Return

void

void hime_painter_draw_image_at(self, image, location, paint)

Draw the image with the origin at the specified location, using the specified paint parameters.

The upper left corner of the bitmap is rendered at the specified location.

Parameters

Return

void

void hime_painter_draw_image(self, image, src, dest, paint)

Draw a portion of an image in the specified location.

The src corresponds to the region of the bitmap to draw in the region defined by the dest coordinates.

If the width or height of the source differs from that of the destination, the image will be scaled. When scaling down, a mipmap will be generated.

Parameters

Return

void