Images and drawimage...

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Skipsy.

Hello folks,

I have some troubles understanding image 'philosophy'...

DrawImage needs an IMAGE_ID as first parameter,but when we use
functions like CreateImage or GrabImage we pass or get a #image
not the ID of that image.
for exemple if I use GrabImage (1, 2, 0,0,50,50) I guess
I have a new 50x50 image with the number 2 which is part of image
1 but.... what is its ID ? how can I display it using DrawImage?

Ouch !! hope it is clear...:)
Thks,
ww
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Hi Skipsy,

Syntax

GrabImage(#Image1, #Image2, x, y, Width, Height)
Description

Create a new #Image2 with the selected area on the source #Image1.

Example:
Load #Image1,"guy_and_gerl.xxx"
......
......
......
GrabImage(#Image1,#ONLY_GUY,guy_x,guy_y,guy_Width,guy_Height)

Result=A new image with ONLY_GUY

Regards,

Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by GPI.

ImageID() returns the id of the actuall image.

but
ImageID=UseImage(#NR) also return the ImageID

so use

DrawImage(useimage(1),10,10)

GPI

p.s.: it is in the Help...

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Skipsy.

Wheeeee !
You 're right... It is in the help...:)

Thks
Post Reply