Registreren   Inloggen   Zoeken:  Nu zoeken
maandag 12 mei 2008
     
VB2005|VB2008 - Capture a screen
Locatie: BlogsMy.Brains.ToString()Visual Basic stuff    
Geplaatst door:  host 25-11-2007 1:20

With help of an object of the type Graphics, it is very easy to make screen capture. Add the next method  to your form:

Public Function CaptureScreen() As Bitmap

  Dim objBitmap As New Bitmap(SystemInformation.VirtualScreen.Width, _
                              SystemInformation.VirtualScreen.Height)

  Using objGraphics As Graphics = Graphics.FromImage(objBitmap)
    objGraphics.CopyFromScreen(0, 0, 0, 0, objBitmap.Size)
  End Using

  Return objBitmap

End Function

Now you can call this function as follows:

PictureBox1.Image = CaptureScreen()

Happy coding!

 


Opmerkingen (1)   Opmerking toevoegen
Re: VB2005|VB2008 - Capture a screen    By Anonymous on 3-1-2008 16:48
Thank you very much ¡¡¡
Happy New Year 2008 from Spain (Valencia)



Titel:
Opmerking:
Opmerking toevoegen   Annuleren 
Location Blog visitors

Locations of visitors to this page

Leer ook Visual Basic!

Visual Basic 2005 - de Basis | André Obelink

Blog List
 
Blog Archive
 


Microsoft Certified Solution Developer

Microsoft Certified Professional

Microsoft Most Valuable Professional

VP Speakers Bureau - INETA Europe

Brainbench Certified Master Visual Basic 6.0 Programmer

Gebruiksovereenkomst   Privacybeleid   Copyright 2005 André Obelink