jascam / AnotherMigrateTest

0 stars 0 forks source link

Issue with embedded bitmap unsing SharpVectors.Runtime in the VS designer #36

Closed jascam closed 7 years ago

jascam commented 7 years ago

Embedded bitmap images via SharpVectors.Runtime work fine at runtime, but in the VS2010 designer I get:   System.InvalidOperationException BitmapImage has not been initialized. Call the BeginInit method, set the appropriate properties, and then call the EndInit method.   I couldn't figure out, where this is going wrong. I've attached a sample project.

Attachments

Test.zip EmbeddedBitmapSource.cs

This work item was migrated from CodePlex

CodePlex work item ID: '543' Vote count: '3'

jascam commented 7 years ago

[SelormeyPaul@5/24/2011] Thanks. Trying to complete the converter application now, will look into it.

jascam commented 7 years ago

[UnknownUser@6/3/2011]

jascam commented 7 years ago

[UnknownUser@6/6/2011]

jascam commented 7 years ago

[UnknownUser@6/6/2011]

jascam commented 7 years ago

[KlausGuetter@6/6/2011] I found that EmbeddedBitmapSource.Data is not set when running in the designer. Maybe VS 2010 handles BitmapSource construction in a special way?

A workaround that worked for me is to override some property getters (DpiX, DpiY, Format, Palette, PixelWidth, PixelHeight) and ensuring that _stream is set. If not, a dummy 1x1 transparent bitmap is constructed and used.

Modified EmbeddedBitmapSource.cs attached.

jascam commented 7 years ago

[SelormeyPaul@6/6/2011] @KlausGuetter thanks for the fix and the contribution.

jascam commented 7 years ago

[etobi@6/8/2011] @Klaus: Just tested your changes - works fine for me. Thx!

jascam commented 7 years ago

[UnknownUser@6/13/2011]

jascam commented 7 years ago

[UnknownUser@2/14/2013]

jascam commented 7 years ago

[UnknownUser@5/16/2013]

jascam commented 7 years ago

Issue closed by SelormeyPaul with comment Fixed in the change set #7326