From: Marc =?ISO-8859-1?Q?Andr=E9?= Tanner on
Hi list,

I'm still quite new to wxWidgets development nonetheless i am currently
trying to implement a GUI for qemu[1]. Qemu can export it's display to
vnc and i try to embed it in my GUI using libvncclient[2]. Think of a
vncviewer with some additional functionality to control a VM.

So, what is the fastest way to draw a bitmap to a wxPanel? I am
currently using the stuff found in wx/rawbmp.h but i am not sure if this
is optimal. Furthermore i have some problems regarding multiple threads,
i have heard that i should only paint from the main thread and use
wxPostEvent from the others, is this the right approach?

It would be great if someone could look through vncpanel.cpp and
vncdisplaythread.cpp files which can be found here:

http://www.brain-dump.org/projects/qemu-gui/doku.php/download

and give me some feedback. The code is currently only (sort of) tested
on wxGTK.

Regards,

Marc

[1] http://www.qemu.org
[2] http://libvncserver.sourceforge.net


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Vadim Zeitlin on
On Mon, 23 Oct 2006 21:44:31 +0200 Marc Andr? Tanner <mat(a)brain-dump.org> wrote:

MAT> So, what is the fastest way to draw a bitmap to a wxPanel?

Just to be clear: drawing bitmap is done using wxDC::DrawBitmap() and
there is really not much choice about it. wxRawBitmap stuff is useful for
modifying the bitmap itself, to avoid working with wxImage which is even
easier to modify but needs to be converted to wxBitmap before being
displayed and this can be prohibitively expensive.

MAT> I am currently using the stuff found in wx/rawbmp.h but i am not sure
MAT> if this is optimal.

If I understand correctly what you want to do (show externally updated RGB
data in a wxWindow (BTW why use wxPanel?)) then I think it is.

MAT> Furthermore i have some problems regarding multiple threads, i have
MAT> heard that i should only paint from the main thread and use
MAT> wxPostEvent from the others, is this the right approach?

All GUI stuff can be only done from the main thread. wxPostEvent can be
used for sending requests or notifications to the main thread from the
other ones.

MAT> It would be great if someone could look through vncpanel.cpp and
MAT> vncdisplaythread.cpp files which can be found here:
MAT>
MAT> http://www.brain-dump.org/projects/qemu-gui/doku.php/download

Sorry, I really don't have time for this (and brain dump frightens me ;-)
but you do seem to be on the right track. If you have any specific problems
post them here and maybe someone can help.

Good luck!
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org