Loading images from memory streams
nummish <[email protected]> Tue, 29 Mar 2005 11:05:05 -0500
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
Hey all, I'm sure this was covered before somewhere, but I couldn't find it in the archives. What I'm trying to do: Embed icons into the assembly, and load them out at runtime into a BitmapButton. Why I don't want to just include it as a file along with the exe: In linux, if you call the application from a different directory, it only checks the working directory for the icons. (if the app is in /usr/bin and I call it from ~/, the bitmaps are nowhere to be found). I'd also like to avoid putting *.bmp files in /usr/bin While asking on irc last night, someone mentioned a decent way to load images from a memory stream for the c++ version of wxw being: wxMemoryInputStream image_stream(arg_data, arg_size); wxImage img(image_stream, wxBITMAP_TYPE_PNG); I couldn't find the MemoryInputStream in the API list, and the only thing similar to that constructor takes an IntPtr (which I'm not 100% sure how to convert anything to) So what I'm actually asking: Is there currently a way to do this? Is there a way that just hasn't been checked in to CVS yet? Or is there a good place for me to start patching? I'm not entirely sure how to convert a C# Stream to a C++/wx Stream, so if it someone could nudge me in the right direction, I'd appreciate it. Thanks, nummish -- 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_id=6595&alloc_id=14396&op=click