Page 1 of 1

Slicing an Image

Posted: Wed Mar 03, 2010 1:02 am
by RoySAC
I want to "slice" an image, e.g. a Font Image with fixed size and ordered characters. For example:

A B C D E F G H I J K L ... etc. Each Letter 32x32 pixels

Coordinates

A = 0,0,31,31
B = 32,0,63,31

.. Etc.

How do I do that with PureBasic?
I don't care too much about the image format. Anything for PNG, JPG, BMP or even RAW binary data would work for me. But I need to be able to use the slice for displaying in my PB app.

Thanks.

Re: Slicing an Image

Posted: Wed Mar 03, 2010 1:14 am
by netmaestro
You'd use GrabImage() for that. Look it up in the doc, give it a try and if you have trouble, let us know.

Re: Slicing an Image

Posted: Wed Mar 03, 2010 3:56 am
by Kaeru Gaman
if you want to display on a screen, you'll load the Image as a Sprite and use ClipSprite.

Re: Slicing an Image

Posted: Sun Mar 07, 2010 10:36 pm
by RoySAC
Thanks a lot, both your options do the trick :)