J
jonfroehlich
I have a fair amount of .png graphic files that I use for image buttons
and other widgets in a .NET CF library that I'm developing. I'm
wondering what the best way is to organize them. I've read previous
posts by others debating the benefits of embedded resources versus
loading them from the disk directly. Given that I'm developing a
library, it would certainly be easier, I believe, if my graphic files
were embedded into the .dll itself. That way, developers wouldn't have
to copy over a lingering resource directory when they wanted to use the
dll. However, I currently load my pngs as IImage objects via
OpenNetCF's ImageFactory.CreateImageFromFile(). This allows me to draw
the pngs with alpha blending. So, my question is, is there an easy way
to load pngs as IImage objects when they are stored as an embedded
resource?
I thought I could do something like:
IImage img;
Stream stream =
Assembly.GetExecutingAssembly().GetManifestResourceStream("my.png"));
new ImagingFactory().CreateImageFromStream(stream, out img);
However, CreateImageFromStream accepts an IStream (not a
System.IO.Stream).
Thanks!
and other widgets in a .NET CF library that I'm developing. I'm
wondering what the best way is to organize them. I've read previous
posts by others debating the benefits of embedded resources versus
loading them from the disk directly. Given that I'm developing a
library, it would certainly be easier, I believe, if my graphic files
were embedded into the .dll itself. That way, developers wouldn't have
to copy over a lingering resource directory when they wanted to use the
dll. However, I currently load my pngs as IImage objects via
OpenNetCF's ImageFactory.CreateImageFromFile(). This allows me to draw
the pngs with alpha blending. So, my question is, is there an easy way
to load pngs as IImage objects when they are stored as an embedded
resource?
I thought I could do something like:
IImage img;
Stream stream =
Assembly.GetExecutingAssembly().GetManifestResourceStream("my.png"));
new ImagingFactory().CreateImageFromStream(stream, out img);
However, CreateImageFromStream accepts an IStream (not a
System.IO.Stream).
Thanks!