How can I...?
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
DisasterMaster

How can I copy an image from the screen to an image in memory. Is it possible?

/Robin



Posted on 2002-07-13 06:05:57

Omni

you should use malloc() to define the size of the image, like this:

imagepointer = malloc(480000)

where 480000 = 800(the screen width) * 400(the screen height) * 1(the color depth in bytes---8-bit color, or 1 byte. 16 bit is 2 bytes.)

Then you should GrabRegion() to grab the screen. For example,

imagepointer = GrabRegion(0 , 0, screenx-1, screeny-1)

I think that's right. I did "-1" because the 0 is inclusive...0 (1 pixel) + 799 = 800 pixels. Or something, it's in the VergeC Function List/Readme at the Vergesource.com.

then you can play with imagepointer like any other image.

TCopySprite(0, 0, blah, blah, imagepointer);

the only difference is that you don't have to use LoadImage() cause it's already in memory.



It is not wrong to not understand, for we are all ignorant, but neither is understanding pointless.

Come visit www.verge-net.com!

Posted on 2002-07-13 09:01:03

DisasterMaster

Thanks, but I already got it. It was in the VergeC.txt all the time. Oops!


/Robin



Posted on 2002-07-13 16:38:51

Omni

(No Text)



It is not wrong to not understand, for we are all ignorant, but neither is understanding pointless.

Come visit www.verge-net.com!

Posted on 2002-07-13 20:38:58


Displaying 1-4 of 4 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.