473,396 Members | 1,871 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.

C# Drawing

in C++, use GetDC to get the DeviceContext.
How to do this in C#?
What object should use to Draw ?
Feb 25 '06 #1
4 6639
You typically draw from within a Paint event handler or the OnPaint override
method. Either way you'll be passed a Graphics object that you can use to
paint.

--
Tim Wilson
..NET Compact Framework MVP

"Dragon" <ta*****@hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
in C++, use GetDC to get the DeviceContext.
How to do this in C#?
What object should use to Draw ?

Feb 25 '06 #2
In addition to Tim's answer, go take a look at the Beginners Guide to GDI+
which is on my site.

www.bobpowell.net

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Dragon" <ta*****@hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
in C++, use GetDC to get the DeviceContext.
How to do this in C#?
What object should use to Draw ?

Feb 25 '06 #3
Thx.
Then how to BitBlt in that Graphic
suppose I have a Image i object;

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> ¼¶¼g©ó¶l¥ó·s»D:eH**************@TK2MSFTNGP15.phx.g bl...
You typically draw from within a Paint event handler or the OnPaint
override
method. Either way you'll be passed a Graphics object that you can use to
paint.

--
Tim Wilson
.NET Compact Framework MVP

"Dragon" <ta*****@hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
in C++, use GetDC to get the DeviceContext.
How to do this in C#?
What object should use to Draw ?


Feb 26 '06 #4
I found it.
e.Graphics.DrawImage
Thx

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> ¼¶¼g©ó¶l¥ó·s»D:eH**************@TK2MSFTNGP15.phx.g bl...
You typically draw from within a Paint event handler or the OnPaint
override
method. Either way you'll be passed a Graphics object that you can use to
paint.

--
Tim Wilson
.NET Compact Framework MVP

"Dragon" <ta*****@hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
in C++, use GetDC to get the DeviceContext.
How to do this in C#?
What object should use to Draw ?


Feb 26 '06 #5

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

Similar topics

0
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
1
by: Hadar | last post by:
Hi, I'm getting "object is currently in use elsewhere" when I use System.Drawing.Graphics.MesureString. This is what I do: My controls use a utility class the helps it to mesure strings. To...
7
by: Marc Pelletier | last post by:
Hello all, I have a class which includes a method to create a chart. I want to be able to call this method from asp.net code as well as windows application code, so I have sketched it out as...
2
by: active | last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not. If I use FromFile on a WMF file that came with VS I get an exception. If I use it on a WMF file created with Bitmap.Save I...
3
by: Chris Saunders | last post by:
I am fairly new to .Net and C# but am familiar with the Win32 API. I wish to set the pixels of the client area of a window one at a time with a specific color. I have so far discovered that...
5
by: Jerry J | last post by:
I want to use the System.Drawing.Image class. According to the help file, this is an abstract base class. Because it is supposedly abstract, I created another class that inherits from it. However,...
1
by: YouPoP | last post by:
I am doing an app (C# 2.0) where you can draw in a panel with your mouse in "real time". I actually have 2 problems; 1- it does not really is "real time", if your mouse move fast or very fast the...
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...
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:
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...
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
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
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.