Poison-ui

A cross-platform desktop/mobile UI engine written in D using dsfml

View project on GitHub

Dub version

poison.ui.picture

Source

Module for picture manipulation.

Authors:

  Jacob Jensen

License:

  https://github.com/PoisonEngine/poison-ui/blob/master/LICENSE

public:




public this(string imageFile);


Creates a new picture.

Parameters:

imageFileThe file for an image to load onto the picture.

public this(Size size, Paint fillPaint);


Creates a new picture.

Parameters:

sizeThe size of the picture.
fillPaintThe initialization paint.

public this(ubyte[] imageBuffer);


Creates a new picture.

Parameters:

imageBufferThe buffer to load the picture from.

public this(Picture copyImage);


Creates a new picture, copied from another.

Parameters:

copyImageThe image to copy.

public void clearGraphics();


Clears the graphics.


public void draw(Point position, Size size, Paint paint);


Draws paint onto the picture.

Parameters:

positionThe position within the picture to draw the paint.
sizeThe size of the paint.
paintThe paint to draw with.

public void gradientHorizontal(Point position, Size size, Paint from, Paint to, ubyte a = 0xff);


Paints a horizontal gradient on the picture.

Parameters:

positionThe position within the picture to paint the gradient.
sizeThe size of the gradient.
fromThe paint to gradient from.
toThe paint to gradient to.
aThe alpha channel of the gradient.

public void gradientVertical(Point position, Size size, Paint from, Paint to, ubyte a = 0xff);


Paints a vertical gradient on the picture.

Parameters:

positionThe position within the picture to paint the gradient.
sizeThe size of the gradient.
fromThe paint to gradient from.
toThe paint to gradient to.
aThe alpha channel of the gradient.

public void resize(Size newSize);


Resizes the picture.

Parameters:

newSizeResizes the picture.

Bug:

  Currently only work for pictures with no image file.The fix is to use scale().

public void finalize();


Finalizes the picture and its graphics.


public @property Size size();


Gets the size of the picture.


public @property string fileName();


Gets the file name.


public @property void fileName(string newFileName);


Sets the file name.


public @property ubyte[] imageBuffer();


Gets the image buffer.


public @property void imageBuffer(ubyte[] imageBuffer);


Sets the image buffer.


Generated by venom - Poison Engine's Documentation Generator