Ved brug af Visual Basic.. he he
Der findes vis ingen nemmere løsning end nedenstående, men jeg synes nu heller ikke den er særlig kompliceret.
Opret nyt projekt. Indsæt en PictureBox (Picture1) med AutoRedraw = True og en knap (Command1).
Indsæt denne kode:
Option Explicit
' Windows API:
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 Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Const HWND_DESKTOP = 0
Private Sub Command1_Click()
Picture1.BorderStyle = 0
Picture1.Width = Screen.Width
Picture1.Height = Screen.Height
' Skjul programmet:
Me.Visible = False
DoEvents
' Tag screenshot:
BitBlt Picture1.hDC, 0, 0, Screen.Width \\ Screen.TwipsPerPixelX, Screen.Height \\ _
Screen.TwipsPerPixelY, GetDC(HWND_DESKTOP), 0, 0, vbSrcCopy
' Vis programmet:
Me.Visible = True
DoEvents
' Gem billedet:
SavePicture Picture1.Image, "screenshot.bmp"
End Sub
Nu kan du tage så mange screenshots du ønsker (filen screenshot.bmp bliver dog overskrevet fra gang til gang!)
Håber du kan bruge det ...
/ Bjarke
--------------------------------------------------
[THIS IS A SIGNATURE VIRUS! PLEASE COPY IT INTO YOUR OWN SIGNATURE(S)]
--------------------------------------------------
Naturvidenskab er interessant:
http://www.unf.dk/