Skip to content

Commit

Permalink
Delete HBITMAP
Browse files Browse the repository at this point in the history
small fixes
  • Loading branch information
harborsiem committed Nov 5, 2023
1 parent acd7970 commit 4bff53b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Ribbon/Interop/RibbonCOMInterfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ public interface IUIImageFromBitmap
HRESULT CreateImage(IntPtr bitmap, Ownership options, [Out, MarshalAs(UnmanagedType.Interface)] out IUIImage image);
}

//following types and interfaces are in UIRibbon since Windows 8, not used yet
//following types and interfaces are in UIRibbon since Windows 8
/// <summary>
/// Identifies the types of events associated with a Ribbon.
/// UI_EVENTTYPE enum
Expand Down
1 change: 0 additions & 1 deletion Ribbon/Interop/StreamAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public StreamAdapter(Stream stream)
/// <param name="streamCopy"></param>
public void Clone(out IStream streamCopy)
{
streamCopy = null;
throw new NotSupportedException();
}

Expand Down
1 change: 1 addition & 0 deletions Ribbon/Ribbon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ public static unsafe Bitmap GetBitmap(IUIImage uiImage)
{
managedBitmap = Bitmap.FromHbitmap(hBitmap);
}
//PInvoke.DeleteObject(hBitmap); //Maybe not a good idea
return managedBitmap;
}

Expand Down
2 changes: 1 addition & 1 deletion RibbonTools/Misc/AlphaBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ public unsafe static Bitmap FromHbitmap(IntPtr hBitmap)
}
else
{
//NativeMethods.DeleteObject((IntPtr)(void*)&bitmapStruct);
managedBitmap = Bitmap.FromHbitmap(hBitmap);
}
NativeMethods.DeleteObject(hBitmap);
return managedBitmap;
}

Expand Down

0 comments on commit 4bff53b

Please sign in to comment.