Slicing an Image

Just starting out? Need help? Post your questions and find answers here.
User avatar
RoySAC
New User
New User
Posts: 5
Joined: Mon Jan 11, 2010 8:13 pm
Location: Fresno, CA
Contact:

Slicing an Image

Post 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.
Cheers!

Carsten aka Roy/SAC
--------------------------
[web] - [blog] - [contact]
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Slicing an Image

Post 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.
BERESHEIT
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Slicing an Image

Post by Kaeru Gaman »

if you want to display on a screen, you'll load the Image as a Sprite and use ClipSprite.
oh... and have a nice day.
User avatar
RoySAC
New User
New User
Posts: 5
Joined: Mon Jan 11, 2010 8:13 pm
Location: Fresno, CA
Contact:

Re: Slicing an Image

Post by RoySAC »

Thanks a lot, both your options do the trick :)
Cheers!

Carsten aka Roy/SAC
--------------------------
[web] - [blog] - [contact]
Post Reply