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

How can I get a bitmap of a Form using .NET 1.1 (ie NO CopyFromScreen)

How can I get a bitmap of a Form using .NET 1.1 (ie NO CopyFromScreen)

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200605/1
May 18 '06 #1
5 3974
Paul,

if you want to implement .NET 2.0's Control.DrawToBitmap
you can do this only by using PInvoke and win32 API.
There are two approaches: sending WM_PRINT message and calling PrintWindow
API.
Both produce similar results, even though they do it in a different way and
both has issues. DrawToBitmap uses WM_PRINT, but I personally found that
PrintWindow produces better results. There are controls such as richeditbox
that doesn't print itself when using either of those methods.

As far as it goes for Graphics.CopyFromScreen you also need to resort to
windows API and use BitBlt method + some of the API methods for obtaining a
device context (HDC) such as GetDC.
--
HTH
Stoitcho Goutsev (100)
"Paul_Madden via DotNetMonster.com" <u21795@uwe> wrote in message
news:606e536381437@uwe...
How can I get a bitmap of a Form using .NET 1.1 (ie NO CopyFromScreen)

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200605/1

May 18 '06 #2
There's always good ol' PrintScreen.
I don't have the code with me, but I've written a screen-grabber app that
sends a PrintScreen key press and gets the bitmap from the clipboard. My app
then crops the bitmap based on its size and position. That could be useful.
May 18 '06 #3
The worst think to do is to use the clipboard without the knoledge of the
user. The user needs to be the one that initiates all clipboard operation.
I'll be really frustrated if I keep some data in the clipboard and when the
time for paste comes to find out that there is some bitmap that I know
nothing about.
--

Stoitcho Goutsev (100)

"PIEBALD" <PI*****@discussions.microsoft.com> wrote in message
news:AF**********************************@microsof t.com...
There's always good ol' PrintScreen.
I don't have the code with me, but I've written a screen-grabber app that
sends a PrintScreen key press and gets the bitmap from the clipboard. My
app
then crops the bitmap based on its size and position. That could be
useful.

May 18 '06 #4
> The worst think to do is to use the clipboard without the knoledge of the
user. The user needs to be the one that initiates all clipboard operation.
I'll be really frustrated if I keep some data in the clipboard and when the
time for paste comes to find out that there is some bitmap that I know
nothing about.


You have to weigh the benefits against the costs. If the application is for
only personal/internal use then why go to the trouble of a more difficult
solution?

other than for educational purposes.
May 18 '06 #5
Also, I wrote the thing in V1.1 and hadn't heard of CopyFromScreen until now
so I'll go back and try that.
May 18 '06 #6

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

Similar topics

2
by: vishal | last post by:
hello friends i have one php script which generates html page containing form. what i want is submit this form using php script. pls give me some idea that how can i submit form using php...
4
by: Chris | last post by:
Dear all, I would like to figure out a way to add controls to a form using specs stored in a table. Any assistance in fleshing this idea out would be greatly appreciated. I'm using VB6. ...
4
by: btopenworld | last post by:
I am submitting a form using an image as the link to a js file. The image calls a js function which checks fields- issuing alerts for errors - if no errors it then submits the form. I would like...
3
by: Justin Sane | last post by:
I haven't been able to select a form using getElementById. I only can select a form using the "name" property of the <form> tag. Is there another way to select a form, or is it even possible to use...
2
by: Sharon | last post by:
I have a Form class that can be open by parent Form or by .NET Remoting command. When the parent Form opens the Form - All fine ! But when the .NET Remoting command is trying to Show the Form, the...
1
by: tmaster | last post by:
Within a class, can I create a property that is a listview? Here's what I tried, but it doesn't seem to work: '------------ create property to give the second form access to the first form's...
2
by: Michael Creager | last post by:
I am using VB NET 2002. How can I programmatically create a new windows form using the value of a string variable as the name of the new form? Public FrmName As String = "MDIChildFrm1" Public...
6
by: James White | last post by:
I wish to open a form using a variable derived from a table. The Application is based on the switchboard principle from Access. However in the absence of do.cmd openForm, I have to use this code....
6
by: Palehorse | last post by:
I'd like to apologize upfront for me saying "I'm not a programer", I'm sure you all hear this a hundred times a day. Unfortunately, in this case, it's true. I've been working on trying to figure out...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.