|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I take a screenshot in VB.net 2005Dim 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 Bob wrote:
> Dim objGraphics As Graphics (it helps to say what error message you get - I am assuming you are> > objGraphics = objGraphics.FromImage(objBitmap) > > Last line wont evaluate in Vs 2005, worked OK in 2003 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 "Bob" <bduf***@sgiims.com> schrieb: Check out 'Graphics.CopyFromScreen' (.NET 2.0).> [Creating a screenshot in .NET 2.0] -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks to you both!
Bob Show quoteHide quote "Bob" <bduf***@sgiims.com> wrote in message news:exH$74FcGHA.3840@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 > > > > > >
Read Emails on Exchange server without OL client
VB2005 timing/speed problem File Names: List Long file Names from Database List of short file names Recursive WebRequest.Create() Call Lisp Program from vb.net help logging events to txt file set focus from treeview to control System.Uri.UserEscaped Compiling internally instead of as a DLL? Invalid format of DLL |
|||||||||||||||||||||||