|
-
Aug 11th, 2000, 01:59 PM
#1
Thread Starter
Hyperactive Member
Hi,
In have made a program that takes a screen shot of the desktop using the GetDesktop and GetDC APIs. After storing the DC in a long called lngPic I would like to turn this into a bitmap but not save it on the hard disk. Any ideas?
-
Aug 11th, 2000, 02:16 PM
#2
transcendental analytic
Use BitBlt api to blit it on a picture, which you save with Savepicture
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 11th, 2000, 02:25 PM
#3
Frenzied Member
err what do you mean turn it to a bitmap and not save it on the hard drive, by taking the screenshot it is already a bitmap in memory, do you mean get at its bitmap handle? if so you want to use the selectobject, deleteobject and createcompatiblebitmap apis
Code:
Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Public Function BitmapFromDC(ByVal hDC As Long) As Long
Dim retval As Long
retval = SelectObject(hDC, CreateCompatibleBitmap(hDC, 1, 1))
DeleteObject SelectObject(hDC, retval)
BitmapFromDC = retval
End Function
hope that's what you wanted.
-
Aug 11th, 2000, 02:36 PM
#4
Thread Starter
Hyperactive Member
Sorry I wasn't clear with the question Sam Finch but you answered my question brilliantly. Thats exactly what I wanted to know. Thanks
[Edited by rino_2 on 08-11-2000 at 03:42 PM]
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
|