Re: Imagefile and resources

nummish <[email protected]> Thu, 14 Apr 2005 09:20:36 -0400
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
I ran into this same problem recently. I've written some patches for
wx.NET, and they're available here: http://www.0x90.org/~nummish/wx/

I haven't had a chance to track down someone to compile the OSX
version, but I do have precompiled gtk & windows binaries if you want
to save yourself some time.

As far as usage goes (assuming your resource is named "online"):

new wx.Bitmap(new wx.Image("online", BitmapType.wxBITMAP_TYPE_RESOURCE))

It should pull it out of the assembly, there are some overloads that
let you specify the assembly to use (it defaults to
Assembly.GetCallingAssembly(), which in this case is whatever assembly
called the Image constructor)

I'd also added an overload to load from a byte[], in case you want to
make images at runtime.


On 4/14/05, Springer Christophe <[email protected]> wrote:
> Hello everybody ;-)
> 
> My probleme is the following :
> I don't want that the users of my application can modify images I
> display (icon for example).
> So I have the idea to use resources with this line of code :
> 
> System.IO.Stream pictStream =
> this.GetType().Assembly.GetManifestResourceStream("online");
> 
> But i don't find any methods to load an image or bitmap from a stream.....
> 
> Is it another solution ?
> 
> Thank you by advance and excuse me for my poor english ;-)
> 
> --
> *******************
> Christophe SPRINGER
> www.ouane.com
> *******************
> 
> 
> 


-- 
Bigger 1:23
This address if for mailing list traffic only. 
Please direct non-list correspondence to 0x90.org


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click