public unsafe static uint GetPaletteEntries(HPALETTE hpal, Span <PALETTEENTRY> entries)
 {
     fixed(PALETTEENTRY *entry = &MemoryMarshal.GetReference(entries))
     {
         return(GetPaletteEntries(hpal, 0, (uint)entries.Length, entry));
     }
 }
Exemple #2
0
        public PaletteHandle(HPALETTE handle, bool ownsHandle = true)
        {
            Debug.Assert(handle.IsInvalid || handle.Value == ((IntPtr)(-1)) ||
                         Imports.GetObjectType(handle) == ObjectType.Palette || Imports.GetObjectType(handle) == 0);

            HPALETTE    = handle;
            _ownsHandle = ownsHandle;
        }
Exemple #3
0
 public SelectPaletteScope(HDC hdc, HPALETTE hpalette, bool forceBackground, bool realizePalette)
 {
     HDC      = hdc;
     HPalette = SelectPalette(hdc, hpalette, forceBackground.ToBOOL());
     if (!HPalette.IsNull && realizePalette)
     {
         RealizePalette((IntPtr)hdc);
     }
 }
Exemple #4
0
 public HRESULT CreateBitmapFromHBITMAP(HBITMAP hBitmap, HPALETTE hPalette, WICBitmapAlphaChannelOption options, IWICBitmap **ppIBitmap)
 {
     return(((delegate * unmanaged <IWICComponentFactory *, HBITMAP, HPALETTE, WICBitmapAlphaChannelOption, IWICBitmap **, int>)(lpVtbl[21]))((IWICComponentFactory *)Unsafe.AsPointer(ref this), hBitmap, hPalette, options, ppIBitmap));
 }
 public static extern HPALETTE SelectPalette(HDC hdc, HPALETTE hPal, BOOL bForceBkgd);
 private unsafe static extern uint GetPaletteEntries(HPALETTE hpal, uint iStart, uint nEntries, PALETTEENTRY *lppe);
Exemple #7
0
 public static extern HPALETTE SelectPalette(HDC hdc, HPALETTE hPal, [MarshalAs(UnmanagedType.Bool)] bool bForceBkgd);
Exemple #8
0
 public static extern bool ResizePalette(HPALETTE hpal, uint n);
Exemple #9
0
 public static extern uint GetPaletteEntries(HPALETTE hpal, uint iStart, uint cEntries, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] PALETTEENTRY[] pPalEntries);
Exemple #10
0
 public static extern uint GetNearestPaletteIndex(HPALETTE hpal, COLORREF crColor);
Exemple #11
0
 public static extern bool AnimatePalette(HPALETTE hPal, uint iStartIndex, uint cEntries, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] PALETTEENTRY[] ppe);