Hi Tamas,
Thank you for your reply,
I tried as you said but still I am getting that HDC is undefined.The
Graphics object (e->Graphics) also does not contains any value .Please look
in to my code .
private: System::Void Form1_Paint(System::Object * sender,
System::Windows::Forms::PaintEventArgs * e)
{
HDC dc=(HDC)e->Graphics->GetHdc().ToPointer();
HDC dc1 = static_cast<HDC>(static_cast<void*>(e->Graphics->GetHdc()));
}
G.Girish
"Tamas Demjen" wrote:
Is it a WinForms application? I have done this before:
void MyControl::OnPaint(PaintEventArgs^ e)
{
HDC dc = static_cast<HDC>(static_cast<void*>(e->Graphics->GetHdc()));
try
{
unmanaged_function(dc);
}
finally
{
e->Graphics->ReleaseHdc(static_cast<IntPtr>(dc));
}
Panel::OnPaint(e);
}
Tom
Girish wrote: Hi ,
I am migrating from VC 6.0 to VC 7.0 with ( windows Control Lib
option in vc dot net ) where I want to draw an image using StretchDIBits. I
am not able to get the HDC of the Window.
I tried using get_handel() which gives undefined value.
Any help regarding this will be great.
Thanx in Advance,
G.Girish