2DDrawing

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

2DDrawing

Post 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
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Yeah, i vote for Drawimagemasked(#image1,#maskimage1,x,y) :)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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) :)
WolfgangS
Enthusiast
Enthusiast
Posts: 174
Joined: Fri Apr 25, 2003 3:30 pm

Post 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 :D

MFG
WolfgangS

PS: Isn't soon Xmas ? :wink:
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Franky
Enthusiast
Enthusiast
Posts: 213
Joined: Sat Apr 26, 2003 2:58 pm

Post 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
Give Up everything but trying!
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

What you say is already provided with CatchImage()

...or GrabImage(), CatchSprite(), GrabSprite(). :)
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Psychophanta wrote:What you say is already provided with CatchSprite(), GrabSprite(). :)
These 2 are now 2Ddrawing functions... So they miss the purpose!
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Num3, i just answered to Franky. Perhaps Franky wanted to manage Screen 2D graphics images in realtime..... :?
Last edited by Psychophanta on Fri Dec 05, 2003 8:19 pm, edited 1 time in total.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Sorry, i understood something else Image

But that is the idea behind this request, to use only 2D commands to do more powerfull things in a image
Franky
Enthusiast
Enthusiast
Posts: 213
Joined: Sat Apr 26, 2003 2:58 pm

Post 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")
Give Up everything but trying!
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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?
User avatar
geoff
Enthusiast
Enthusiast
Posts: 128
Joined: Sun Apr 27, 2003 12:01 am
Location: Cornwall UK
Contact:

Post 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.
Franky
Enthusiast
Enthusiast
Posts: 213
Joined: Sat Apr 26, 2003 2:58 pm

Post 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
Give Up everything but trying!
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Then with an inverse fuction of ImageID() that would be made.
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

Franky, check out this:
viewtopic.php?t=8524
Post Reply