Skip to content

Can not save Bitmap to MemoryStream #20

@mrzaxaryan

Description

@mrzaxaryan

Repro
var img = new Bitmap(128, 128);
using var ms = new MemoryStream();
img.Save(ms, ImageFormat.Png);
StackTrace
at WinFormsComInterop.WinFormsComWrappers.ComputeVtables(Object, CreateComInterfaceFlags, Int32&) + 0x1af
at System.Runtime.InteropServices.ComWrappers.CreateCCW(Object, CreateComInterfaceFlags) + 0x39
at System.Runtime.InteropServices.ComWrappers.<>c__DisplayClass14_0.b__0(Object) + 0x1c
at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValueLocked(TKey, ConditionalWeakTable2.CreateValueCallback) + 0x2d
at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValue(TKey, ConditionalWeakTable2.CreateValueCallback) + 0x3e
at System.Runtime.InteropServices.ComWrappers.GetOrCreateComInterfaceForObject(Object, CreateComInterfaceFlags) + 0xa8
at System.Runtime.InteropServices.ComWrappers.ComInterfaceForObject(Object, Guid) + 0xe
at System.Drawing.SafeNativeMethods.Gdip.GdipSaveImageToStream(HandleRef, Interop.Ole32.IStream, Guid&, HandleRef) + 0xbd
at System.Drawing.Image.Save(Stream, ImageCodecInfo, EncoderParameters) + 0x144
at Test.Program.Main() + 0x8f

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions