473,769 Members | 6,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Screen capture

Per
Hi all,
This may be a newbie question, but I can't find the answer anywhere.
I want to make a capture of the screen, or a part of the screen, that
contains the main portion of the form.
Detecting the screen that contain the main portion of the form is pretty
straight forward, but how do I capture what I need in an Image object?
Another thing, how do you make the program move the mouse pointer and
simulate clicks?

Best regards
Nov 16 '05 #1
3 2215
To capture the complete screen:
Public Shared Function CaptureScreen() As Bitmap

Dim strKeys As String = "^{PRTSC}"
SendKeys.SendWa it(strKeys)
Dim iData As IDataObject = Clipboard.GetDa taObject()
If (iData.GetDataP resent(DataForm ats.Bitmap)) Then
Dim memoryImage As New
Bitmap(CType(iD ata.GetData("Sy stem.Drawing.Bi tmap"), Bitmap))
Return memoryImage
End If

'-- Unable to obtain screenShot from clipboard
Return Nothing
End Function
- José
"Per" <no****@nospam. com> wrote in message
news:1S******** **********@news 2.e.nsc.no...
Hi all,
This may be a newbie question, but I can't find the answer anywhere.
I want to make a capture of the screen, or a part of the screen, that
contains the main portion of the form.
Detecting the screen that contain the main portion of the form is pretty
straight forward, but how do I capture what I need in an Image object?
Another thing, how do you make the program move the mouse pointer and
simulate clicks?

Best regards

Nov 16 '05 #2
Hi Per,

To move the mouse pointer and simulate clicks you can use SendInput function
(Win32 function).

Regards,

"Per" wrote:
Hi all,
This may be a newbie question, but I can't find the answer anywhere.
I want to make a capture of the screen, or a part of the screen, that
contains the main portion of the form.
Detecting the screen that contain the main portion of the form is pretty
straight forward, but how do I capture what I need in an Image object?
Another thing, how do you make the program move the mouse pointer and
simulate clicks?

Best regards

Nov 16 '05 #3
Per
Thanks alot José, this code was a great help:-)

Per
"José Joye" <jo************ **********@blue win.ch> wrote in message
news:Ok******** ******@TK2MSFTN GP10.phx.gbl...
To capture the complete screen:
Public Shared Function CaptureScreen() As Bitmap

Dim strKeys As String = "^{PRTSC}"
SendKeys.SendWa it(strKeys)
Dim iData As IDataObject = Clipboard.GetDa taObject()
If (iData.GetDataP resent(DataForm ats.Bitmap)) Then
Dim memoryImage As New
Bitmap(CType(iD ata.GetData("Sy stem.Drawing.Bi tmap"), Bitmap))
Return memoryImage
End If

'-- Unable to obtain screenShot from clipboard
Return Nothing
End Function
- José
"Per" <no****@nospam. com> wrote in message
news:1S******** **********@news 2.e.nsc.no...
Hi all,
This may be a newbie question, but I can't find the answer anywhere.
I want to make a capture of the screen, or a part of the screen, that
contains the main portion of the form.
Detecting the screen that contain the main portion of the form is pretty
straight forward, but how do I capture what I need in an Image object?
Another thing, how do you make the program move the mouse pointer and
simulate clicks?

Best regards


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
13531
by: Me Mine | last post by:
i, I have trying to code a small console app that will allow a user to select a window and then create a screen capture of the window. I haven't been able to figure out how to do the screen capture part. The code is as follows, the commented out lines at the end are things I have tried, but don't work. Whenever I try to create a compatibe Bitmap or DC it comes back with an error as win32ui: CreateCompatibleDC failed
1
2962
by: xc | last post by:
Greetings. I encountered a wield problem when grabing screen images. Sometimes in some computers I can capture the screen, but other times not so. In some computer I cannot capture the screen image, but when I change its color bits, say from 32bits to 24 or 16bits, the program can capture the image. Can anyone kindly examine my following code, and point out the flaw:
1
6498
by: Jody Gelowitz | last post by:
I have seen some examples of how to capture a color from a point on screen using C#, but haven't come across anything with VB.NET. Is this possible under VB.NET? I know that I will need to use the GetPixel API in order to do this. Essentially, I would like to be able to move the mouse around the screen, and wherever the left button is clicked, I would like to store the color value of the point where the cursor is located. If possible,...
2
2219
by: Eddie Dunn | last post by:
I have one here that I cannot find anything on in my searching. I am implementing a screen capture functionality into my Visual Basic ..NET application. The code I am using calls the bitblt function in gdi32.dll to achieve its magic as follows: Public Function CreateScreenshot() As Bitmap
2
2415
by: py | last post by:
I need to take a screen shot of the computer screen. I am trying to use PIL and I saw there is ImageGrab...however it only works on Windows. Is there a platform-independent ability to work around this? thanks
4
5374
by: gwhite1 | last post by:
I use this code to capture a screen in a regular VB 2005 windows app. It works great! I found the code in google. But when I create a windows service it does not capture the screen. It only captures a blank graphic. Does anyone know why it will not capture the current screen? Is something not available when running as a service? Thanks!!! Sheila Function CreateScreenshot() As System.Drawing.Bitmap Dim Rect As System.Drawing.Rectangle =...
2
6624
by: dumbledad | last post by:
Hi All, I'm using ASP.Net web services to provide the logic required for a Flash based prototype. The Flash and the ASP .Net run together on the client machine. One of the functions I'd like to offer is public void StoreLogEntry(string tag, string description, bool screenshotRequired)
4
4005
by: Paolo Pantaleo | last post by:
Hi, I need to capture a screen snapshot in Linux. PIL has a module IageGrab, but in the free version it only works under Windows. Is there any package to capture the screen on Linux? Thnx PAolo
5
9019
Atran
by: Atran | last post by:
Hello Everyone. In this article: You will know to capture the screen in 2 ways: 1)- Capture full screen. 2)- Capture region. Let's Begin: First make a new Windows Application project. And make sure your program uses these namespaces: using System;
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10222
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9999
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.