
How can I stream to a wxImage?
-
- Knows some wx things
- Posts: 28
- Joined: Mon Mar 14, 2005 2:16 am
How can I stream to a wxImage?
I've looked at the image example and it shows streaming, but here's my problem. I'd like to do the stream reading into the wxImage myself because I want to have a progress bar (for loading very large images) and a cancel button while loading. When I pass a wxFileInputStream to wxImage::Load, it loads the thing by itself, and I have no time to display the progrmess bar, etc. Any ideas on how I might go about this? Is there soem way I can manually stream into a wxImage or wxBitmap? Thanks. 

-
- Earned some good credits
- Posts: 132
- Joined: Mon Apr 04, 2005 12:54 am
- Location: California
- Contact:
You could try writing your own wxImageHandler but I have no idea how.
I see said the blind man to the deaf girl who was mute.
Visit my project at: http://vwp.sourceforge.net
wx version:2.6.2 and 2.6.3 on linux
OS's:Windows XP, Gentoo is the best!!!!!!
compiler:Codeblocks(MingW32) and gcc on linux
Visit my project at: http://vwp.sourceforge.net
wx version:2.6.2 and 2.6.3 on linux
OS's:Windows XP, Gentoo is the best!!!!!!
compiler:Codeblocks(MingW32) and gcc on linux
-
- Knows some wx things
- Posts: 28
- Joined: Mon Mar 14, 2005 2:16 am
-
- Knows some wx things
- Posts: 28
- Joined: Mon Mar 14, 2005 2:16 am
Hi!
As for the second question: Call the "normal" version of the methods with a wxFileInputStream:: prefix. So for calling wxFileInputStreams Ok() method use wxFileInputStream::Ok().
I just had a look at the code and I'd say that you should overload the wxStreamBase::OnSysRead() method as it is declared as a pure virtual function for wxInputStream and gets called by wxInputStream::Read() internaly.Nintendofreak88 wrote:So should I overload the wxInputStream::Read method or the wxStreamBase::OnSysRead method? Also if I were to overload it how could i call the wxFileInputStream's version of the method from my new method?
As for the second question: Call the "normal" version of the methods with a wxFileInputStream:: prefix. So for calling wxFileInputStreams Ok() method use wxFileInputStream::Ok().
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
-
- Knows some wx things
- Posts: 28
- Joined: Mon Mar 14, 2005 2:16 am