Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / XPM in Windows

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. XPM in Windows
#3508
Posted by: 2004-03-15 00:12:03
Hi all.
I'm trying to load xpm icon in wxWidgets under windows.

If i include the xpm file like this:
#include "icon.xpm"

and then use: wxIcon(icon_xpm); it work OK.

but i need to load an ico from file, and for some reason
the icon->LoadFile("icon.xpm",wxBITMAP_TYPE_XPM,-1,-1) fails.

I walked the function with debugger and found that it fails cos
it can't find handler that will be able to load xpm file.
and the docs say that it IS possible to do so.
so does anyone know how?
Message2. Re: XPM in Windows
#3510
Posted by: upCASE 2004-03-15 15:37:21
Hi!
Either use
wxImage::AddHandler(new wxXPMHandler);
or
wxInitAllImageHandlers();
in your code before trying to load the image.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: XPM in Windows
#3511
Posted by: 2004-03-15 23:54:01
Thanks man, it works ok now.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥880.00 ·
 
 
¥1,390.00 ·
 
 
¥1,380.00 ·
 
 
¥287.00 ·
 
 
¥918.00 ·
 
 
¥860.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0