Ejemplo n.º 1
0
            /// <summary>
            /// Extracts 16*16 icon when ImageContainer is constructed with PowerItem data
            /// </summary>
            public void ExtractSmall()
            {
                if (_smallBitmap != null)
                {
                    return;
                }
                var smallIconHandle = GetUnmanagedIcon(API.Shgfi.SMALLICON);

                if (smallIconHandle != IntPtr.Zero)
                {
                    SmallBitmap = ExtractInternal(smallIconHandle);
                    SmallBitmap.Freeze();
                    Util.PostBackgroundIconDestroy(smallIconHandle);
                }
#if DEBUG
                else
                {
                    Log.Raw("FAILED with code " + Marshal.GetLastWin32Error(), _initialObject);
                }
#endif
                _smallExtracted = true;
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructs the instance of ImageContainer from the HICON extracted already
 /// </summary>
 /// <param name="unmanagedIcon">HICON you have already extracted</param>
 public ImageContainer(IntPtr unmanagedIcon)
 {
     SmallBitmap = ExtractInternal(unmanagedIcon);
     SmallBitmap.Freeze();
     LargeBitmap = SmallBitmap;
 }