Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[wx 2.5.3, mac os x 10.3.7, gcc 3.3] problem regarding wxGenericDirCtrl

16 views
Skip to first unread message

krystian

unread,
Jan 29, 2005, 1:12:26 PM1/29/05
to
hi all,

currently i am trying to make a wxGenericDirCtrl list files and
not just directories. The wxDIRCTRL_DIR_ONLY flag is *not* set,
but it just shows directories and no files at all except symlinks.

is this a bug, a feature or just my goofiness?

please let me know ...


tia + kind regards,
krystian

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org

Robert J. Lang

unread,
Jan 31, 2005, 9:22:13 PM1/31/05
to
Hi,

Is there a simple way to get the screen image in a wxGLCanvas into a
wxBitmap or wxImage (so it can be saved to a file)? Ideally cross-platform,
but specifically I'm on wxMac.

Thanks,

Robert

Mitch Chapman

unread,
Feb 1, 2005, 10:36:12 AM2/1/05
to
Robert J. Lang wrote:
> Hi,
>
> Is there a simple way to get the screen image in a wxGLCanvas into a
> wxBitmap or wxImage (so it can be saved to a file)? Ideally cross-platform,
> but specifically I'm on wxMac.

If you don't mind reading wxPython code, this could help:

http://lists.wxwidgets.org/archive/wxPython-users/msg21060.html

The above omits one step: before invoking glReadPixels be sure to call
glPixelStorei(GL_PACK_ALIGNMENT, 1).

--
Mitch

Robert J. Lang

unread,
Feb 2, 2005, 12:43:15 PM2/2/05
to
on 2/1/05 7:35 AM, Mitch Chapman at mi...@predict.com wrote:

> Robert J. Lang wrote:
>> Is there a simple way to get the screen image in a wxGLCanvas into a
>> wxBitmap or wxImage (so it can be saved to a file)? Ideally cross-platform,
>> but specifically I'm on wxMac.
>
> If you don't mind reading wxPython code, this could help:
> http://lists.wxwidgets.org/archive/wxPython-users/msg21060.html
> The above omits one step: before invoking glReadPixels be sure to call
> glPixelStorei(GL_PACK_ALIGNMENT, 1).

> Mitch

Hey, that was pretty clear even in Python (;o)) and it works. Thanks! Here's
the C++ version:

GLint view[4];
glGetIntegerv(GL_VIEWPORT, view);
void* pixels = malloc(3 * view[2] * view[3]);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, view[2], view[3], GL_RGB, GL_UNSIGNED_BYTE, pixels);
wxImage image((int) view[2], (int) view[3]);
image.SetData((unsigned char*) pixels);
image = image.Mirror(false);

Robert

0 new messages