|
-
Apr 7th, 2002, 01:01 PM
#1
Thread Starter
Hyperactive Member
Dynamic creation of bitmaps
I'm creating a chess game (mostily in OpenGL) and am currently designing the backgrounds. Currently, I just can open any Bitmap, which is fairly cool. I was wondering, though, if it is possible to take a snap shot of the desktop (using WinAPI) and then convert it to a *.bmp file, all within the program (i.e. the program has to do it). Note: I know how to the get the bitmap into, say a picture box. The question has, how do I get that into a standard bitmap file.
-
Apr 7th, 2002, 04:51 PM
#2
Fanatic Member
-
Apr 7th, 2002, 05:29 PM
#3
Thread Starter
Hyperactive Member
Thanks.....
.......but that doesn't entirely answer my question (however, it did answer many other questions!).
I know how to get bitmaps (e.g. the desktop) using API. My problem is that I have to turn that into an external file (i.e.
Code:
sub exportBMP ()
dim fileNum as integer
fileNum = freeFile
open *.bmp for binary as fileNum 'Open a file for ouput as binary
.
. 'This is the part I need to know (header, file format...)
.
close fileNum
end sub
But again, thanks for the link, it is quite useful.
-
Apr 8th, 2002, 11:52 AM
#4
Fanatic Member
For the file format of a bmp file you can look at wotsit.org.
If you want to do it the easy way, you should get your bitmap into a picture box (you seem to know how you should do that) and then save the contents of the picture box with SavePicture.
-
Apr 9th, 2002, 01:38 PM
#5
Frenzied Member
if you just want to save a bitmap without any special things you can use the savepicture method of the picturebox.
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 9th, 2002, 01:46 PM
#6
Good Ol' Platypus
Yes, but remember anything you transfer onto the Picturebox must be saved from the .Image, not the .Picture of the PictureBox.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|