ColinRaaijmaker
09-24-2009, 08:52 PM
I am creating an application for my Logitech G19 keyboard with a LCD screen.
First i created a bitmap where i put some information on (such as text) to put on my lcd screen.
Dim bmpNet As Bitmap
...etc...etc... put information, text...etc...
Then, i have to convert the bitmap to bytes/intptr as the following line says with GetBitmapBits:
GetBitmapBits(bmpNet.GetHbitmap, lcdBMPQVGAx32.pixels.Length, lcdBMPQVGAx32.pixels)
Function is declere on top of my source code as:
<DllImport("gdi32.dll", CharSet:=CharSet.Auto, SetLastError:=True, ExactSpelling:=True)> _
Public Shared Function GetBitmapBits(ByVal hbmp As IntPtr, ByVal cbBuffer As Integer, ByVal lpvBits As Byte()) As Integer
End Function
Now, every time GetBitmapBits invokes, the memory of my application will encrease with 200kB/300kB. I have a timer ticking, so the memory will encrease every, 2 a 3 seconds.
Can someone help me with this problem?
Thanks in advance.
Colin Raaijmakers
First i created a bitmap where i put some information on (such as text) to put on my lcd screen.
Dim bmpNet As Bitmap
...etc...etc... put information, text...etc...
Then, i have to convert the bitmap to bytes/intptr as the following line says with GetBitmapBits:
GetBitmapBits(bmpNet.GetHbitmap, lcdBMPQVGAx32.pixels.Length, lcdBMPQVGAx32.pixels)
Function is declere on top of my source code as:
<DllImport("gdi32.dll", CharSet:=CharSet.Auto, SetLastError:=True, ExactSpelling:=True)> _
Public Shared Function GetBitmapBits(ByVal hbmp As IntPtr, ByVal cbBuffer As Integer, ByVal lpvBits As Byte()) As Integer
End Function
Now, every time GetBitmapBits invokes, the memory of my application will encrease with 200kB/300kB. I have a timer ticking, so the memory will encrease every, 2 a 3 seconds.
Can someone help me with this problem?
Thanks in advance.
Colin Raaijmakers