capture a control and send the image to a clipboard or image file

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: capture a control and send the image to a clipboard or image file

  1. #1
    Join Date
    Mar 2008

    capture a control and send the image to a clipboard or image file

    there is any way to capture a control and send the image of that control to a clipboard or image file?
    thanks a lot for your help

  2. #2
    Join Date
    May 2008
    Chicago, IL
    You can capture a screen, or capture a form. Search for the one that you want. There are many examples out there.
    David CodeGuru Article: Bound Controls are Evil-VB6

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Here is one way
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    ByVal bScan As Byte, _ 
    ByVal dwFlags As Long, _
    ByVal dwExtraInfo As Long) 
    Private Const VK_SNAPSHOT = &H2C 
    Private Function SaveScreen(ByVal theFile As String) As Boolean 
    On Error Resume Next 
    'To get the Entire Screen 
    Call keybd_event(vbKeySnapshot, 1, 0, 0) 
    'To get the Active Window 
    'Call keybd_event(vbKeySnapshot, 0, 0, 0) 
    SavePicture Clipboard.GetData(vbCFBitmap), theFile 
    SaveScreen = True 
    Exit Function 
    End Function 
    Private Sub Command1_Click()
    Call SaveScreen("C:\Windows\Desktop\shot1.bmp") 
    End Sub
    Is that what you are looking for?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  4. #4
    Join Date
    Aug 2004

    Could it be this easy?

    Have you tried something like this

    Clipboard.SetData Command1.Picture

Similar Threads

  1. Replies: 1
    Last Post: 01-28-2008, 09:36 AM
  2. Replies: 2
    Last Post: 11-22-2006, 08:05 PM
  3. How to send a message to a button on a tab control
    By quantum1976 in forum VB Classic
    Replies: 1
    Last Post: 02-17-2006, 02:51 PM
  4. Sending mail with image problem
    By vikassheelgupta in forum Java
    Replies: 0
    Last Post: 01-06-2006, 01:12 AM
  5. Replies: 0
    Last Post: 04-10-2002, 01:08 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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center