DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    164

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

    hi,
    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
    Location
    Chicago, IL
    Posts
    64
    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
    Location
    Sterling Heights, Michigan
    Posts
    8,649
    Here is one way
    Code:
    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
    Posts
    4

    Could it be this easy?

    Hi.
    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

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links