B
Benjamin Lukner
Hi!
When using the Full Framework, it's quite easy to get the handle of a
bitmap object:
Private _bmp As System.Drawing.Bitmap
Private _graphics As System.Drawing.Graphics
_bmp = New System.Drawing.Bitmap(100, 100)
_graphics = Graphics.FromImage(_bmp)
Dim hDC As IntPtr
hDC = _graphics.GetHdc
'[...]
_graphics.ReleaseHdc(hDC)
But in Compact Framework GetHdc and ReleaseHdc aren't implemented.
I can use the following code to get the handle of a control:
Me.Capture = True
hWnd = GetCapture
Me.Capture = False
hDC = GetDC(hWnd)
'[...]
ReleaseDC(hWnd, hDC)
But my custom control is double buffered. So I have to get the device
context of my bitmap, not from the control it's painted on.
Does anyone know how to do it?
Kind regards,
Benjamin Lukner
When using the Full Framework, it's quite easy to get the handle of a
bitmap object:
Private _bmp As System.Drawing.Bitmap
Private _graphics As System.Drawing.Graphics
_bmp = New System.Drawing.Bitmap(100, 100)
_graphics = Graphics.FromImage(_bmp)
Dim hDC As IntPtr
hDC = _graphics.GetHdc
'[...]
_graphics.ReleaseHdc(hDC)
But in Compact Framework GetHdc and ReleaseHdc aren't implemented.
I can use the following code to get the handle of a control:
Me.Capture = True
hWnd = GetCapture
Me.Capture = False
hDC = GetDC(hWnd)
'[...]
ReleaseDC(hWnd, hDC)
But my custom control is double buffered. So I have to get the device
context of my bitmap, not from the control it's painted on.
Does anyone know how to do it?
Kind regards,
Benjamin Lukner