You still haven't answered the question. What are you trying to get the
graphics instance of? Are you trying to manipulate an image? Or are you
trying to custom paint your control?
If you are trying to custom paint your control, and you are in a class
that derives from that control, then you can override the OnPaint method and
get the Graphics instance from the PaintEventArgs that is passed in to the
method.
If you want to do this outside of the control, you will have to
subscribe to the Paint event and then get the Graphics instance from the
PaintEventArgs passed to the event.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
<vi********@rediffmail.comwrote in message
news:c0**********************************@l6g2000p rm.googlegroups.com...
Hi Nicholas/Ben,
Thanks for your reply.
I too used the Graphics.FromImage() but I am facing some problems
using it in my control. Is there any other way to get the graphics?
On Dec 26, 9:28 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Well, what kind of class do you want to generate a device context for
(which the Graphics class is really a wrapper for).
What exactly are you trying to do? The device context is something that
is typically generated for you. Unless you have some sort of output device
which windows doesn't handle (which would be wrong, since you should go
through the hardware abstraction layer to get a device context to output
on
anyways), you really shouldn't be creating a Graphics instance yourself.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
<vijay_3...@rediffmail.comwrote in message
news:34**********************************@e25g2000 prg.googlegroups.com...
Hi,
How to write a CreateGraphics method for a class similar to
form.CreateGraphics()?
Pls help. Thanks in Advance.- Hide quoted text -
- Show quoted text -