Using GetSystemPaletteEntries
From: Just Me (groups_at_a-znet.com)
Date: 02/18/05
- Next message: Dan: "Re: compiling dll"
- Previous message: Mark Rae: "Re: Window Registry"
- Next in thread: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Reply: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 17 Feb 2005 19:55:49 -0500
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
- Next message: Dan: "Re: compiling dll"
- Previous message: Mark Rae: "Re: Window Registry"
- Next in thread: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Reply: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|