public void method_0(Struct9 A_0) { object obj2 = Marshal.PtrToStructure(A_0.intptr_0, typeof(CLIPDATA)); this.clipdata_0 = (CLIPDATA)obj2; this.byte_0 = new byte[this.clipdata_0.uint_0]; Marshal.Copy(this.clipdata_0.intptr_0, this.byte_0, 0, this.byte_0.Length); }
// Getting inconsistent results. Need to work on code. public Bitmap GetThumbnail() { Bitmap bitmap = null; PROPVARIANT propvar = default(PROPVARIANT); try { Marshal.ThrowExceptionForHR(GetPropertyValue(FMTID.FMTID_ExtendedSummaryInformation, (uint)ExtendedSummaryInformationConstants.LARGE_DIB, out propvar)); if (propvar.Type == VarEnum.VT_CF) { // Get CLIPDATA. CLIPDATA clipdata = propvar.GetCLIPDATA(); // built-in Windows format if (clipdata.ulClipFmt == -1) { // Pointer to BITMAPINFOHEADER. IntPtr pBIH = clipdata.pClipData; bitmap = DibToBitmap.Convert(pBIH); } else { Console.WriteLine("CLIP FORMAT ERROR"); Marshal.ThrowExceptionForHR(HRESULT.DV_E_CLIPFORMAT); } } else { Console.WriteLine("INVALID VARIANT ERROR"); Marshal.ThrowExceptionForHR(HRESULT.ERROR_INVALID_VARIANT); } } catch { throw; } finally { propvar.Clear(); } return(bitmap); }