public static BOOL GetImageInfo(HandleRef himl, int i, ref IMAGEINFO pImageInfo)
            {
                BOOL result = GetImageInfo(himl.Handle, i, ref pImageInfo);

                GC.KeepAlive(himl.Wrapper);
                return(result);
            }
예제 #2
0
        public ImageListItem GetItemInfo(int index)
        {
            IMAGEINFO info = new IMAGEINFO();

            NativeMethods.ImageList_GetImageInfo(Handle, index, ref info);
            return(new ImageListItem(info));
        }
예제 #3
0
        private Size GetImageIconSize(int index)
        {
            IMAGEINFO imgInfo = new IMAGEINFO();
            int       hr      = 0;

            if (_iImageList == null || Thread.CurrentThread.GetApartmentState() == ApartmentState.MTA)
            {
                hr = ImageList_GetImageInfo(_ptrImageList, index, ref imgInfo);
            }
            else
            {
                hr = _iImageList.GetImageInfo(index, ref imgInfo);
            }

            if (hr != 0)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            RECT rect = imgInfo.rcImage;

            return(new Size(rect.right - rect.left, rect.bottom - rect.top));
        }
 public static extern BOOL GetImageInfo(IntPtr himl, int i, ref IMAGEINFO pImageInfo);
예제 #5
0
 internal extern static int ImageList_GetImageInfo(
     IntPtr himl,
     int i,
     ref IMAGEINFO pImageInfo);
예제 #6
0
 internal ImageListItem(IMAGEINFO nativeInfo)
 {
     Bitmap     = new Bitmap(nativeInfo.hbmImage);
     MaskBitmap = new Bitmap(nativeInfo.hbmMask);
     Frame      = nativeInfo.rcImage;
 }
예제 #7
0
 internal extern static int ImageList_GetImageInfo(
     IntPtr himl,
     int i,
     ref IMAGEINFO pImageInfo);
 public static partial BOOL GetImageInfo(IntPtr himl, int i, ref IMAGEINFO pImageInfo);