Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 50 additions & 114 deletions src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

23 changes: 22 additions & 1 deletion src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.ComponentModel;
using System.Drawing.Imaging;
using System.Drawing.Internal;
using System.IO;
using System.Runtime.InteropServices;
using Gdip = System.Drawing.SafeNativeMethods.Gdip;
Expand All @@ -14,7 +15,7 @@ namespace System.Drawing
"System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public sealed partial class Bitmap : Image
public sealed class Bitmap : Image
{
private static readonly Color s_defaultTransparentColor = Color.LightGray;

Expand Down Expand Up @@ -53,6 +54,26 @@ public Bitmap(Stream stream) : this(stream, false)
{
}

public unsafe Bitmap(Stream stream!!, bool useIcm)
{
using DrawingCom.IStreamWrapper streamWrapper = DrawingCom.GetComWrapper(new GPStream(stream));

IntPtr bitmap = IntPtr.Zero;
if (useIcm)
{
Gdip.CheckStatus(Gdip.GdipCreateBitmapFromStreamICM(streamWrapper.Ptr, &bitmap));
}
else
{
Gdip.CheckStatus(Gdip.GdipCreateBitmapFromStream(streamWrapper.Ptr, &bitmap));
}

ValidateImage(bitmap);

SetNativeImage(bitmap);
EnsureSave(this, null, stream);
}

public Bitmap(Type type, string resource) : this(GetResourceStream(type, resource))
{
}
Expand Down

This file was deleted.

This file was deleted.

Loading