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); }
public ImageListItem GetItemInfo(int index) { IMAGEINFO info = new IMAGEINFO(); NativeMethods.ImageList_GetImageInfo(Handle, index, ref info); return(new ImageListItem(info)); }
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);
internal extern static int ImageList_GetImageInfo( IntPtr himl, int i, ref IMAGEINFO pImageInfo);
internal ImageListItem(IMAGEINFO nativeInfo) { Bitmap = new Bitmap(nativeInfo.hbmImage); MaskBitmap = new Bitmap(nativeInfo.hbmMask); Frame = nativeInfo.rcImage; }
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);