Search found 43 matches

by Peer Sommerlund
Mon May 21, 2007 7:53 pm
Forum: The Code Dump
Topic: improved high quality image downscaling
Replies: 2
Views: 1422

The algorithm only works for downscaling. It is slower than wxIMAGE_QUALITY_HIGH, since it uses float math. (wxIMAGE_QUALITY_HIGH is blur + sample which is integer math only) The process is simple: For each target pixel, compute the average colour of the corresponding area on the source image. Note ...
by Peer Sommerlund
Mon May 21, 2007 1:34 pm
Forum: The Code Dump
Topic: improved high quality image downscaling
Replies: 2
Views: 1422

improved high quality image downscaling

Hello.

The following patch to the image sample shows a different method for downscaling images, that provides a higher quality image than "high quality" scaling.

Regards,
Peer
by Peer Sommerlund
Thu Jan 11, 2007 7:17 pm
Forum: wxDev-C++
Topic: waiting for a wxProcess
Replies: 6
Views: 1211

Your code seems to indicate that you want a sequential flow, where you call the external encrypt program, wait for it, then contine to the next item that needs encryption. Why not use the syncronous version of wxExecute? wxExecute(const wxString& command, wxArrayString& output, int flags = 0); It wi...
by Peer Sommerlund
Thu Jan 11, 2007 7:09 pm
Forum: wxDev-C++
Topic: wondering is wxdev for me???
Replies: 7
Views: 1024

The license of CodeBlocks is GPL, see http://www.codeblocks.org/license.shtml .. but that only means that you will have to publish any modifications you make to the CodeBlocks source code - and you will probably not modify it. wxSmith generates code but does not force a license on you. The source co...
by Peer Sommerlund
Wed Jan 10, 2007 8:39 am
Forum: wxDev-C++
Topic: waiting for a wxProcess
Replies: 6
Views: 1211

Are you developing a GUI application? In this case you are probably preventing the main thread from doing anything besides waiting in your "while(!encryptDlg->done);" loop. A solution could be to restructure the code to use events instead of polling. I'm not sure what to do if you do not have a GUI....
by Peer Sommerlund
Wed Jan 10, 2007 8:08 am
Forum: wxDev-C++
Topic: wondering is wxdev for me???
Replies: 7
Views: 1024

You could also consider CodeBlocks. It runs on OS X as well as the other platforms you mentioned.

See http://www.codeblocks.org/

It includes wxSmith - a tool for designing a gui. See http://wiki.codeblocks.org/index.php?ti ... h_features
by Peer Sommerlund
Tue Nov 28, 2006 2:21 pm
Forum: Platform Related Issues
Topic: wxThread modify the wxBitmap of a wxScrolledWindow - HOWTO
Replies: 2
Views: 842

Maybe the wxWiki can help you. It contains a page about Flicker-Free Drawing
by Peer Sommerlund
Tue Nov 21, 2006 9:38 pm
Forum: C++ Development
Topic: Problem with wxThread::Wait - hangs console App
Replies: 8
Views: 1534

So, everything works fine -- except when you are debugging inside Visual Studio. The code looks fine to me. Have you considered debugging it using log-files instead of a debugger? :wink: This is what I do. I often find that too many things happen that is not reproducable in a debugger. Also, race co...
by Peer Sommerlund
Tue Nov 21, 2006 7:48 am
Forum: C++ Development
Topic: Problem with wxThread::Wait - hangs console App
Replies: 8
Views: 1534

Could you post
1) the content of wxThread::Entry() -- or just the important parts
2) the content of the function that waits & deletes the thread
3) the content of the function that creates & runs your thread
4) a descriptoin of your program, what does it do, how many threads are it using.

Regards
by Peer Sommerlund
Mon Nov 20, 2006 8:46 am
Forum: C++ Development
Topic: Deadlock in GetWindowTextLength, wxDialog with a Thread
Replies: 1
Views: 324

Uh, maybe the problem is that when you destroy a thread under Windows, it will die immedieately? That could explain why the thread does not return. If this is the case, then you can solve it by using a mutex/critical section to prevent the destruction of the thread while it is updating: - enter sect...
by Peer Sommerlund
Mon Nov 20, 2006 8:41 am
Forum: C++ Development
Topic: wxThread.Wait() generate error messages
Replies: 2
Views: 672

The documentation is not good enough here. :( The current implementation (at least wxMSW) requires you to do EITHER Delete() OR Wait().

That is, Delete includes an implicit Wait.

If you do both, you will be waiting on a non-existing object.

See bug 1225646 on SF
by Peer Sommerlund
Fri Nov 17, 2006 7:14 am
Forum: C++ Development
Topic: wxProcess::Redirect shutdown problem
Replies: 7
Views: 1331

:oops: My mistake. I ran the exec sample on another computer using mingw and wxMSW-2.6.2 and the GUI did not lock up. I must have selected syncronous or something. BTW, wxInputStream::CanRead() is virtual, and wxExecute creates a wxPipedInputStream, which uses the non-blocking PeekNamedPipe. My mist...
by Peer Sommerlund
Thu Nov 16, 2006 10:39 am
Forum: C++ Development
Topic: Anything wrong with this? wxThread, wxCondition problem
Replies: 7
Views: 921

As I understand the semantics of condition.wait, it will unlock the mutex while waiting for the condition AND THEN RELOCK IT when it is signalled.. Thus, the second time you manually call lock, it will be locked already. The wxWidgets documentation is not clear on this, but try to read e.g. http://w...
by Peer Sommerlund
Wed Nov 15, 2006 8:59 am
Forum: C++ Development
Topic: Anything wrong with this? wxThread, wxCondition problem
Replies: 7
Views: 921

It seems to me that you forget to unlock the mutexes. I would have used wxMutexLocker instead of manually calling Lock inside the code. As Jorg writes, the intended use of condition and mutex is a bit different from this example. A quick search on the net for a tutorial: http://developer.apple.com/d...
by Peer Sommerlund
Tue Nov 14, 2006 10:22 pm
Forum: C++ Development
Topic: wxProcess::Redirect shutdown problem
Replies: 7
Views: 1331

I just compiled the exec sample, and given a client application that simply stops sending on stdout, it blocks the GUI. This is the behaviour I was seeking to avoid. Using a thread, prevents the GUI from locking up, but trades it for a shut-down problem. Try with a client similar to the code below. ...