J
Just Me
I've been trying to debug this but when it executes GetSystemPaletteEntries
it bombs. I mean it just dies.
I set a breakpoint an try to get QuickWatch to evaluate
GetSystemPaletteEntries(...) and it say - Evaluation stopped..
Any ideas?
Thanks
Dim lHDCMemory As IntPtr
Dim lHBmp As IntPtr
Dim lHPal As IntPtr
Dim lHBmpPrev As IntPtr
Dim lHPalPrev As IntPtr
Dim lHDCSrc As IntPtr
Dim lRasterCapabilities As Integer
Dim lHasPalette As Boolean
Dim lPaletteSize As Integer
Dim lLogPal As GDI.LOGPALETTE
lHDCSrc = User.GetWindowDC(hWndSrc)
lHDCMemory = GDI.CreateCompatibleDC(lHDCSrc)
lHBmp = GDI.CreateCompatibleBitmap(lHDCSrc, widthSrc, heightSrc)
lHBmpPrev = GDI.SelectObject(lHDCMemory, lHBmp)
lRasterCapabilities = GDI.GetDeviceCaps(lHDCSrc, GDI.RASTERCAPS)
lHasPalette = (lRasterCapabilities And GDI.RC_PALETTE) = GDI.RC_PALETTE
lPaletteSize = GDI.GetDeviceCaps(lHDCSrc, User.SIZEPALETTE)
If lHasPalette AndAlso (lPaletteSize = 256) Then
lLogPal.palVersion = &H300S
lLogPal.palNumEntries = 256
ReDim lLogPal.palPalEntry(255)
Try
Dim zz As Integer = GDI.GetSystemPaletteEntries(lHDCSrc, 0, 256,
lLogPal.palPalEntry)
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
it bombs. I mean it just dies.
I set a breakpoint an try to get QuickWatch to evaluate
GetSystemPaletteEntries(...) and it say - Evaluation stopped..
Any ideas?
Thanks
Dim lHDCMemory As IntPtr
Dim lHBmp As IntPtr
Dim lHPal As IntPtr
Dim lHBmpPrev As IntPtr
Dim lHPalPrev As IntPtr
Dim lHDCSrc As IntPtr
Dim lRasterCapabilities As Integer
Dim lHasPalette As Boolean
Dim lPaletteSize As Integer
Dim lLogPal As GDI.LOGPALETTE
lHDCSrc = User.GetWindowDC(hWndSrc)
lHDCMemory = GDI.CreateCompatibleDC(lHDCSrc)
lHBmp = GDI.CreateCompatibleBitmap(lHDCSrc, widthSrc, heightSrc)
lHBmpPrev = GDI.SelectObject(lHDCMemory, lHBmp)
lRasterCapabilities = GDI.GetDeviceCaps(lHDCSrc, GDI.RASTERCAPS)
lHasPalette = (lRasterCapabilities And GDI.RC_PALETTE) = GDI.RC_PALETTE
lPaletteSize = GDI.GetDeviceCaps(lHDCSrc, User.SIZEPALETTE)
If lHasPalette AndAlso (lPaletteSize = 256) Then
lLogPal.palVersion = &H300S
lLogPal.palNumEntries = 256
ReDim lLogPal.palPalEntry(255)
Try
Dim zz As Integer = GDI.GetSystemPaletteEntries(lHDCSrc, 0, 256,
lLogPal.palPalEntry)
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try