|
-
Jun 4th, 2000, 03:43 AM
#1
Thread Starter
Frenzied Member
Does anyone know where i can get source that takes apicture of the screen, i.e. a screen shot, without using the Print Screen button ?
-
Jun 4th, 2000, 05:54 AM
#2
transcendental analytic
You could use bitblt with the desktop's wnd's DC, into a picturebox which picture you can copy into the clipboard, that does the same
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.
-
Jun 4th, 2000, 09:08 AM
#3
_______
worth a try
'screen grab...command1 and picture1 required
'
Private Declare Function GetDC Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function StretchBlt Lib _
"gdi32" (ByVal hdc As Long, ByVal x As Long, _
ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, _
ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, _
ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Sub Command1_Click()
Dim wScreen As Long
Dim hScreen As Long
Dim w As Long
Dim h As Long
Picture1.Cls
wScreen = Screen.Width \ Screen.TwipsPerPixelX
hScreen = Screen.Height \ Screen.TwipsPerPixelY
Picture1.ScaleMode = vbPixels
w = Picture1.ScaleWidth
h = Picture1.ScaleHeight
hdcScreen = GetDC(0)
r = StretchBlt(Picture1.hdc, 0, 0, w, h, hdcScreen, 0, 0, wScreen, hScreen, vbSrcCopy)
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 4th, 2000, 05:50 PM
#4
transcendental analytic
Stretchblt is slow, if you nessarily needs to youse it, use painpicture instead. Also, why not make a picture with the size of the desktop and then use bitblt with it?
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.
-
Jun 5th, 2000, 12:36 AM
#5
Thread Starter
Frenzied Member
Thanks, i'm not up to speed on bitblt thingy so i'll try that long bit of code first. Thanks to all those of answered though.
-
Jun 5th, 2000, 12:43 AM
#6
Thread Starter
Frenzied Member
i tried that big bit of code, it is extreemly slow or does not work, how do i use paint picture. i got this far
Private Sub Command1_Click()
Picture1.PaintPicture
End Sub
What goes next ?
-
Jun 5th, 2000, 02:27 AM
#7
transcendental analytic
formorpicturebox.Paintpicture picture,x1,y1,w1,h1,x2,y2,w2,h2,vbsrccopy
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.
-
Jun 5th, 2000, 02:48 AM
#8
Member
U could try.......
Okay this sets the screen shot as the form picture but can easilly be modified:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" _
(ByVal hDestDC As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
Private Sub Form_Load()
Form1.AutoRedraw = True
Form1.ScaleMode = 1
A = GetDesktopWindow()
s = GetDC(A)
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, s, 0, 0, vbSrcCopy
End Sub
Right i hope that helps
Cease
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
|