CSharpGL.Win32.CreateDIBSection C# (CSharp) Метод

CreateDIBSection() приватный Метод

private CreateDIBSection ( IntPtr hdc, [ pbmi, uint pila, IntPtr &ppvBits, IntPtr hSection, uint dwOffset ) : IntPtr
hdc IntPtr
pbmi [
pila uint
ppvBits IntPtr
hSection IntPtr
dwOffset uint
Результат IntPtr
        internal static extern IntPtr CreateDIBSection(IntPtr hdc, [In] ref BitmapInfo pbmi,
           uint pila, out IntPtr ppvBits, IntPtr hSection, uint dwOffset);

Usage Example

Пример #1
0
        /// <summary>
        /// Resizes the section.
        /// </summary>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="bitCount">The bit count.</param>
        public void Resize(int width, int height, int bitCount)
        {
            //	Destroy existing objects.
            this.DestroyBitmap();

            //  Set parameters.
            this.Width  = width;
            this.Height = height;

            //	Create a bitmap info structure.
            var info = new BitmapInfo();

            info.Init();

            //	Set the data.
            info.biBitCount = (short)bitCount;
            info.biPlanes   = 1;
            info.biWidth    = width;
            info.biHeight   = height;

            //	Create the bitmap.
            this.HBitmap = Win32.CreateDIBSection(this.MemoryDeviceContext, ref info, Win32.DIB_RGB_COLORS,
                                                  out this.bits, IntPtr.Zero, 0);

            Win32.SelectObject(this.MemoryDeviceContext, this.HBitmap);
        }
All Usage Examples Of CSharpGL.Win32::CreateDIBSection