D
DraguVaso
Hi,
In the override of the Paint-method of a DataGridTextBoxColumn I want to
show an image with BitBlt, to see what I can gain there on performance.
The problem is: It doesn't show me the image in the DataGrid-Cell's, but a
black background...
Does anybody has any idea what I am doing wrong?
Thanks a lot in advance,
Pieter
Declare Auto Function BitBlt Lib "GDI32.DLL" ( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Int32) As Boolean
Private Const SRCCOPY As Integer = &HCC0020
Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal
bounds As Rectangle, ByVal source As CurrencyManager, ByVal rowNum As
Integer, ByVal backBrush As Brush, ByVal foreBrush As Brush, ByVal
alignToRight As Boolean)
Dim rectB As New Rectangle
rectB = bounds
rectB.Width = rectB.Width + 1
Dim g3 As Graphics
g3 = Graphics.FromImage(fe.BackgroundImage)
'fe.BackgroundImage is a bitmap I read from a stream (PixelFormat =
Format32bppPArgb)
Dim HDC1 As IntPtr = g.GetHdc
Dim HDC2 As IntPtr = g3.GetHdc
Me.BitBlt(HDC1, 0, 0, rectB.Width, rectB.Height, HDC2, 0, 0,
SRCCOPY)
g.ReleaseHdc(HDC1)
g3.ReleaseHdc(HDC2)
....
In the override of the Paint-method of a DataGridTextBoxColumn I want to
show an image with BitBlt, to see what I can gain there on performance.
The problem is: It doesn't show me the image in the DataGrid-Cell's, but a
black background...
Does anybody has any idea what I am doing wrong?
Thanks a lot in advance,
Pieter
Declare Auto Function BitBlt Lib "GDI32.DLL" ( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Int32) As Boolean
Private Const SRCCOPY As Integer = &HCC0020
Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal
bounds As Rectangle, ByVal source As CurrencyManager, ByVal rowNum As
Integer, ByVal backBrush As Brush, ByVal foreBrush As Brush, ByVal
alignToRight As Boolean)
Dim rectB As New Rectangle
rectB = bounds
rectB.Width = rectB.Width + 1
Dim g3 As Graphics
g3 = Graphics.FromImage(fe.BackgroundImage)
'fe.BackgroundImage is a bitmap I read from a stream (PixelFormat =
Format32bppPArgb)
Dim HDC1 As IntPtr = g.GetHdc
Dim HDC2 As IntPtr = g3.GetHdc
Me.BitBlt(HDC1, 0, 0, rectB.Width, rectB.Height, HDC2, 0, 0,
SRCCOPY)
g.ReleaseHdc(HDC1)
g3.ReleaseHdc(HDC2)
....