Page 1 of 1
2DDrawing
Posted: Mon Dec 01, 2003 1:48 pm
by Num3
Would be nice to have a few more commands to the 2DDrawing set.
CopyImage(#originalimage,#newimage[,x,y,w,h])
copy and / or crop a image into a new image
Drawimagemasked(#image1,#maskimage1,x,y)
To draw a masked image
This would be very handy to make games, without DX

using only regular 2DDrawing commands
Posted: Mon Dec 01, 2003 7:51 pm
by Berikco
Yeah, i vote for Drawimagemasked(#image1,#maskimage1,x,y)

Posted: Tue Dec 02, 2003 10:48 am
by Psychophanta
num3 wrote:
CopyImage(#originalimage,#newimage[,x,y,w,h])
copy and / or crop a image into a new image
...or tile (if x+w,y+h are out of bounds from #originalimage)

Posted: Tue Dec 02, 2003 2:27 pm
by WolfgangS
Psychophanta wrote:num3 wrote:
CopyImage(#originalimage,#newimage[,x,y,w,h])
copy and / or crop a image into a new image
...or tile (if x+w,y+h are out of bounds from #originalimage)

An additional parameter to convert the depth would be also fine
MFG
WolfgangS
PS: Isn't soon Xmas ?

Posted: Tue Dec 02, 2003 4:23 pm
by Franky
What about that?
Copyimagefromadress(imageadress,#newimage)
Could need it for images from the Clipboard
You can get the adress of an image, which is Copied, but you can´t use it
There is no possibility to get the width and height without the Api or something like this
Posted: Tue Dec 02, 2003 8:22 pm
by Psychophanta
What you say is already provided with CatchImage()
...or GrabImage(), CatchSprite(), GrabSprite().

Posted: Fri Dec 05, 2003 8:04 pm
by Num3
Psychophanta wrote:What you say is already provided with CatchSprite(), GrabSprite().

These 2 are now 2Ddrawing functions... So they miss the purpose!
Posted: Fri Dec 05, 2003 8:11 pm
by Psychophanta
Num3, i just answered to Franky. Perhaps Franky wanted to manage Screen 2D graphics images in realtime.....

Posted: Fri Dec 05, 2003 8:19 pm
by Num3
Sorry, i understood something else
But that is the idea behind this request, to use only 2D commands to do more powerfull things in a image
Posted: Sun Dec 07, 2003 11:47 am
by Franky
What you say is already provided with CatchSprite(), GrabSprite().
So,if it is, why doesn´t this work?
Code: Select all
CatchImage(1,GetClipboardData(#pb_clipboard_image))
SaveImage(1,"test.bmp")
Copied an image from a directory :"Pointer is NULL"
Made a screenshot: no debuggermessage but a message from windows;
Windowsproblemmessage(in german:
Windowsproblembericht")
Posted: Sun Dec 07, 2003 3:26 pm
by Psychophanta
Mmmmh, well, i've never understood what means "handle" for microsoft terminology. I thought it is a pointer, but i was wrong.
Anyway, now the question for you is: how to get a pointer from a image handle?
Posted: Mon Dec 08, 2003 12:04 pm
by geoff
The API command
BitBlt(DC1,x1,y1,wd,ht,DC2,x2,y2,mode)
allows copy of part of an image into another image.
But I agree that a Purebasic "wrapper" on this command would be useful because it would remove the hassle of creating, releasing and deleting Windows device contexts.
Also, I prefer to avoid API and assembler where possible so that my code is simpler, more portable and future-proof.
Posted: Tue Dec 09, 2003 10:38 am
by Franky
Hi
the question is not how to get a pointer from a image handle, i think the worth given back by getclipboarddata() is the same as Useimage(), so i could drawthe image into my own image(?)
the question is how to get the width and height of the image
Posted: Tue Dec 09, 2003 12:53 pm
by Psychophanta
Then with an inverse fuction of ImageID() that would be made.
Posted: Tue Dec 09, 2003 1:06 pm
by Pupil
Franky, check out this:
viewtopic.php?t=8524