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

Drawing on screen

Hi,
I want to draw directly on to the screen. I think i should get the Graphics
object of the screen. It's easy to get do it in C++ (by GetWindowDC(NULL)).
But how to do that in C# ?

Thanks
Nov 16 '05 #1
2 5481
Graphics g= Graphics.FromHwnd(this.Handle);

You can download a working gdi+ application here:
http://www.geocities.com/jeff_louie/OOP/oop19.htm

Regards,
Jeff
I want to draw directly on to the screen. I think i should get the

Graphics object of the screen. It's easy to get do it in C++ (by
GetWindowDC(NULL)).But how to do that in C# ?<

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #2
Hi,

You need to use GDI+

I have staterted my own beginners guide to GDI+ at
http://www.publicjoe.f9.co.uk/csharp/csharp21.html which talks through doing
this.

I also have a few articles aimed at beginners on my articles page found at
http://www.publicjoe.f9.co.uk/csharp.../articles.html

Also check out the chapters in my ebook page (link below)

Hope this helps

Publicjoe

C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Tutorial at http://www.publicjoe.f9.co.uk/vbnet/vbnet.html
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html
Mirrors at http://www.dowhileloop.com/publicjoe/ and
http://www.publicjoe.justbe.com/

Useful Articles at http://www.madsally.co.uk

"Hai Ly Hoang" <No*****@Mail.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
Hi,
I want to draw directly on to the screen. I think i should get the Graphics object of the screen. It's easy to get do it in C++ (by GetWindowDC(NULL)). But how to do that in C# ?

Thanks

Nov 16 '05 #3

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

Similar topics

6
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters...
11
by: Galen Somerville | last post by:
In my opinion, one of the worst failures of Net (VB2005 Pro) was not providing an XOR line draw feature, as in VB6. A major feature of my app is allowing the user to draw Markers (vertical...
10
by: Paul | last post by:
Hi, I was wondering if anyone knows if it is possible in C# given x,y coordinates of several straight lines to draw these on the screen and then save this as an image file, also adding text to the...
9
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I...
1
by: Marc the Demi-Programmer | last post by:
I am overriding WncProc to make sure my form's location stays within specified parameters. Basically, it has to stay at the top of the screen and not be off to either of the sides. All that works...
4
by: Galen Somerville | last post by:
My VB2005 app gets real time Heart sounds and an ECG from a USB device. I'm looking for a way to speed up the drawing of the traces on the screen. In the following code the routine GetSounds...
11
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1,...
2
by: ThatsIT.net.au | last post by:
I have this code that writes a pie chart in a asp.net page, but I want to use it in a server control. When I try I get a error on the last line "Response.OutputStream" Obviously there is no...
7
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
2
by: ouzsharp | last post by:
The follwing class works well when used in a C# console application: namespace ScreenShotDemo { /// <summary> /// Provides functions to capture the entire screen, or a particular...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
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,...
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...

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.