Ejemplo n.º 1
0
        /// <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)));
        }
Ejemplo n.º 2
0
        /// <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));
        }