473,378 Members | 1,580 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,378 software developers and data experts.

How do I take a screenshot in VB.net 2005

Bob
Dim objRectangle As Rectangle = Screen.PrimaryScreen.Bounds

Dim objBitmap As New Bitmap(objRectangle.Right, objRectangle.Bottom)

Dim objGraphics As Graphics

objGraphics = objGraphics.FromImage(objBitmap)

Last line wont evaluate in Vs 2005, worked OK in 2003

Thanks for help

Bob


May 5 '06 #1
3 6615
Bob wrote:
Dim objGraphics As Graphics

objGraphics = objGraphics.FromImage(objBitmap)

Last line wont evaluate in Vs 2005, worked OK in 2003

(it helps to say what error message you get - I am assuming you are
getting "Access of shared member, constant member, enum member or
nested type through an instance; qualifying expression will not be
evaluated.")
FromImage is a Shared method of Graphics - that is it 'belongs' to the
class, not to any particular instance. Pre-VB2005, this (technically
incorrect) syntax of invoking class methods through an instance was
allowed without comment. In VB2005, it is by default a warning. The
correct syntax is

objGraphics = Graphics.FromImage(objBitmap)
--
Larry Lard
Replies to group please

May 5 '06 #2
"Bob" <bd*****@sgiims.com> schrieb:
[Creating a screenshot in .NET 2.0]


Check out 'Graphics.CopyFromScreen' (.NET 2.0).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
May 5 '06 #3
Bob
Thanks to you both!
Bob
"Bob" <bd*****@sgiims.com> wrote in message
news:ex**************@TK2MSFTNGP04.phx.gbl...
Dim objRectangle As Rectangle = Screen.PrimaryScreen.Bounds

Dim objBitmap As New Bitmap(objRectangle.Right, objRectangle.Bottom)

Dim objGraphics As Graphics

objGraphics = objGraphics.FromImage(objBitmap)

Last line wont evaluate in Vs 2005, worked OK in 2003

Thanks for help

Bob


May 6 '06 #4

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...
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...
6
by: M | last post by:
Hello, I'm looking for a way to get a screenshot of the current browser (or current tab browser) from a javascript. Any clue is welcome ! Thanx. M
2
by: Rohit111111 | last post by:
Hi All, I need Help,I am using vb.net 2005 I have to show the screenshot of url on a web page,url are come from database,i have to show the thumbnail images of these url on my page Plese help me ...
4
by: Daniel | last post by:
How to take an IE rendered screenshot of a website with visual studio .net 2002 or visual stuido .net 2003? I can't install visual studio .net 2005 on this computer.
7
by: Guy Cohen | last post by:
Hi all I need to get the desktop screenshot. I use vb.net 2005 The function/sub should run in a DLL and not a form (I cannot use "Imports System.Drawing" because of that..) Please advise - I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.