Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have been trying to get my manifested resouces from my app directly into an object variable but I cannot find a method to do it.

 

Bitmap.FromStream() seems to do this. But how can I do this?

 

Stream s= Assembly.GetCallingAssembly().GetManifestResourceStream(name);

object o= //Get Object from Stream Code Here.

C#
  • *Gurus*
Posted
Look in to serialization, which is converting an object to data which is persistable. The Bitmap class has a custom serializer/deserializer which can operate on a byte array of bitmap data rather than serialized data describing the class itself, that's how it works.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

Oh, ok, so Images are an exception to serialization. I tried serialization but because it did not work on an Image I asked this question.

 

Are Images the only exception?

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...