473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

screenshot in GDI....

using vb.net 2003. i got capturescreen working . what i wanted is how to
used mouse to specifying area of desktop . does ne 1 knows commands
it is like pointoclient....?
regards

Nov 20 '05 #1
7 1773
* Supra <su*****@rogers.com> scripsit:
using vb.net 2003. i got capturescreen working . what i wanted is how
to used mouse to specifying area of desktop . does ne 1 knows commands

it is like pointoclient....?


I am not sure how this should work. When clicking to select a position
where the selected area starts, the window under the mouse pointer
receives the click event, so it's not that easy to provide a selection
mechanism.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
make take a snapshot of the whole desktop, then use the mouse to select the
area of your bitmap and dispose of the rest.

Willl this work?

Shane
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2k************@uni-berlin.de...
* Supra <su*****@rogers.com> scripsit:
using vb.net 2003. i got capturescreen working . what i wanted is how
to used mouse to specifying area of desktop . does ne 1 knows commands

it is like pointoclient....?


I am not sure how this should work. When clicking to select a position
where the selected area starts, the window under the mouse pointer
receives the click event, so it's not that easy to provide a selection
mechanism.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3
* "SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> scripsit:
make take a snapshot of the whole desktop, then use the mouse to select the
area of your bitmap and dispose of the rest.


Yes, this will work. You can add a handler to a picturebox's 'MouseUp'
event and get the coordinates there ('e.X', 'e.Y').

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
ur ideas will work. all u have to do is used e.X and e.Y. i was
thinking specified area and then into bitmap or image .
regards

SStory wrote:
make take a snapshot of the whole desktop, then use the mouse to select the
area of your bitmap and dispose of the rest.

Willl this work?

Shane
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2k************@uni-berlin.de...

* Supra <su*****@rogers.com> scripsit:

using vb.net 2003. i got capturescreen working . what i wanted is how
to used mouse to specifying area of desktop . does ne 1 knows commands

it is like pointoclient....?

I am not sure how this should work. When clicking to select a position
where the selected area starts, the window under the mouse pointer
receives the click event, so it's not that easy to provide a selection
mechanism.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Nov 20 '05 #5
ur ideas will work. all u have to do is used e.X and e.Y. i was
thinking specified area and then into bitmap or image .
regards,

SStory wrote:
make take a snapshot of the whole desktop, then use the mouse to select the
area of your bitmap and dispose of the rest.

Willl this work?

Shane
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2k************@uni-berlin.de...

* Supra <su*****@rogers.com> scripsit:

using vb.net 2003. i got capturescreen working . what i wanted is how
to used mouse to specifying area of desktop . does ne 1 knows commands

it is like pointoclient....?

I am not sure how this should work. When clicking to select a position
where the selected area starts, the window under the mouse pointer
receives the click event, so it's not that easy to provide a selection
mechanism.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Nov 20 '05 #6
here is code:

Protected Sub CaptureScreen()

Dim hSDC, hMDC As Integer
Dim hBMP, hBMPOld As Integer
Dim r As Integer

hSDC = CreateDC("DISPLAY", "", "", "")
hMDC = CreateCompatibleDC(hSDC)

FW = GetDeviceCaps(hSDC, 8)
FH = GetDeviceCaps(hSDC, 10)
hBMP = CreateCompatibleBitmap(hSDC, FW, FH)

hBMPOld = SelectObject(hMDC, hBMP)
r = BitBlt(hMDC, 0, 0, FW, FH, hSDC, 0, 0, 13369376)
hBMP = SelectObject(hMDC, hBMPOld)

r = DeleteDC(hSDC)
r = DeleteDC(hMDC)

oBackground = Image.FromHbitmap(New IntPtr(hBMP))
DeleteObject(hBMP)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
CaptureScreen()
PictureBox1.Image = oBackground
End Sub

Herfried K. Wagner [MVP] wrote:
* "SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> scripsit:

make take a snapshot of the whole desktop, then use the mouse to select the
area of your bitmap and dispose of the rest.


Yes, this will work. You can add a handler to a picturebox's 'MouseUp'
event and get the coordinates there ('e.X', 'e.Y').


Nov 20 '05 #7
this code will work. i will have to copy from capturescreeen into
mouseup evernt and get e.X and e.Y into bitblt.
thank..
regsrds,
Herfried K. Wagner [MVP] wrote:
* "SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> scripsit:

make take a snapshot of the whole desktop, then use the mouse to select the
area of your bitmap and dispose of the rest.


Yes, this will work. You can add a handler to a picturebox's 'MouseUp'
event and get the coordinates there ('e.X', 'e.Y').


Nov 20 '05 #8

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

Similar topics

4
by: Saqib Ali | last post by:
Hello All, A while back I ran into a site which enabled to the users to get a ScreenShot of a specified webpage as viewed in Mac OS X's web browser (safari). I lost my bookmark in a machine...
4
by: Aaron | last post by:
can i use asp.net to capture a screen shot of a webpage? something like this? http://img.nameintel.com/Thumbnails/tn.html?domain=cnn.com Is there a script that does this? Aaron
1
by: jani | last post by:
Hi all, does anyone know how to take a screenshot of a winform using c#? I have an Add-In program for MS Word in c#, and want to render the WinForm to a gif image, then insert the screenshot into...
6
by: Geert M | last post by:
Hello, I'm busy working on a "small" sms application. I'm able to access all remote pc's (for which I am Local Admin) information using WMI and API calls for some things. But I can't figure out...
3
by: Dean Slindee | last post by:
I would like to capture a picture of the active window on the screen to use in an error routine. Like the following, which captures the entire desktop: Dim objRectangle As Rectangle =...
1
by: Yosh | last post by:
I want to be able to capture a screenshot of a windows form that is hidden. My goal here is to create a form of any particular size (the size could be larger than the screen), get a screenshot, and...
2
by: Java Boy | last post by:
Is it possible to fetch a webpage and take screenshot of it like it displays in browser and then store it in jpg/gif thanks -- Geeks Home www.fahimzahid.com
19
by: mareeus | last post by:
Hi, Are there any ways I could get a screenshot of a web-page at a specific address in jpeg via php script? Regards, Marius.
5
by: sharkbate24 | last post by:
Hello, I need some help please. I already know how to capture the full screen, because the .NET framework simplifies it a lot. Anyway, I was wondering, is it possible to capture a Window /...
13
by: epid | last post by:
I have a problem that I'm not sure there is a solution for... I have a lookup field in a table that allows multiple values and the display control is set to be a List Box. The list box looks fine on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.