/// <summary> /// Read a single icon (.ico). /// </summary> /// <param name="lpData">Pointer to the beginning of this icon's data.</param> /// <param name="lpAllData">Pointer to the beginning of all icon data.</param> /// <returns>Pointer to the end of this icon's data.</returns> internal IntPtr Read(IntPtr lpData, IntPtr lpAllData) { _header = (Kernel32.FILEGRPICONDIRENTRY)Marshal.PtrToStructure( lpData, typeof(Kernel32.FILEGRPICONDIRENTRY)); IntPtr lpImage = new IntPtr(lpAllData.ToInt32() + _header.dwFileOffset); _image.Read(lpImage, _header.dwImageSize); return(new IntPtr(lpData.ToInt32() + Marshal.SizeOf(_header))); }
/// <summary> /// Read the bitmap image. /// </summary> /// <param name="dibBits">DIB bits.</param> /// <param name="size">Size of image.</param> internal virtual void ReadImage(IntPtr dibBits, UInt32 size) { _image.Read(dibBits, size); }