4 * Author: Robert Roebling
6 * Copyright: (C) 1998, Robert Roebling
10 // For compilers that support precompilation, includes "wx/wx.h".
11 #include "wx/wxprec.h"
23 #include "wx/mstream.h"
24 #include "wx/wfstream.h"
25 #include "wx/quantize.h"
38 class MyCanvas
: public wxScrolledWindow
42 MyCanvas( wxWindow
*parent
, wxWindowID
, const wxPoint
&pos
, const wxSize
&size
);
44 void OnPaint( wxPaintEvent
&event
);
45 void CreateAntiAliasedBitmap();
47 wxBitmap
*my_horse_png
;
48 wxBitmap
*my_horse_jpeg
;
49 wxBitmap
*my_horse_gif
;
50 wxBitmap
*my_horse_bmp
;
51 wxBitmap
*my_horse_bmp2
;
52 wxBitmap
*my_horse_pcx
;
53 wxBitmap
*my_horse_pnm
;
54 wxBitmap
*my_horse_tiff
;
55 wxBitmap
*my_horse_xpm
;
56 wxBitmap
*my_horse_ico32
;
57 wxBitmap
*my_horse_ico16
;
58 wxBitmap
*my_horse_ico
;
59 wxBitmap
*my_horse_cur
;
61 wxBitmap
*my_smile_xbm
;
68 wxBitmap m_bmpSmileXpm
;
69 wxIcon m_iconSmileXpm
;
72 DECLARE_DYNAMIC_CLASS(MyCanvas
)
77 const int nChoices
= 8 ;
78 static const wxString bppchoices
[nChoices
] =
84 _T("8 bpp greyscale"),
86 _T("8 bpp own palette"),
90 static const int bppvalues
[nChoices
] =
105 class MyFrame
: public wxFrame
110 void OnAbout( wxCommandEvent
&event
);
111 void OnNewFrame( wxCommandEvent
&event
);
112 void OnQuit( wxCommandEvent
&event
);
117 DECLARE_DYNAMIC_CLASS(MyFrame
)
118 DECLARE_EVENT_TABLE()
121 class MyImageFrame
: public wxFrame
124 MyImageFrame(wxFrame
*parent
, const wxBitmap
& bitmap
)
125 : wxFrame(parent
, -1, _T("Double click to save"),
126 wxDefaultPosition
, wxDefaultSize
,
127 wxCAPTION
| wxSYSTEM_MENU
),
130 SetClientSize(bitmap
.GetWidth(), bitmap
.GetHeight());
133 void OnPaint(wxPaintEvent
& WXUNUSED(event
))
135 wxPaintDC
dc( this );
136 //TRUE for masked images
137 dc
.DrawBitmap( m_bitmap
, 0, 0, TRUE
);
140 void OnSave(wxCommandEvent
& WXUNUSED(event
))
142 wxImage image
= m_bitmap
.ConvertToImage();
144 int bppselection
= wxGetSingleChoiceIndex(_T("Set BMP BPP"),
149 if ( bppselection
== -1 )
155 image
.SetOption(wxIMAGE_OPTION_BMP_FORMAT
, bppvalues
[bppselection
]);
157 wxString deffilename
= bppchoices
[bppselection
];
158 deffilename
.Replace(wxT(" "), wxT("_"));
159 deffilename
+= wxT(".bmp");
160 wxString savefilename
= wxFileSelector( wxT("Save Image"),
163 (const wxChar
*)NULL
,
164 wxT("BMP files (*.bmp)|*.bmp|")
165 wxT("PNG files (*.png)|*.png|")
166 wxT("JPEG files (*.jpg)|*.jpg|")
167 wxT("GIF files (*.gif)|*.gif|")
168 wxT("TIFF files (*.tif)|*.tif|")
169 wxT("PCX files (*.pcx)|*.pcx|")
170 wxT("ICO files (*.ico)|*.ico|")
171 wxT("CUR files (*.cur)|*.cur"),
174 if ( savefilename
.empty() )
177 if ( image
.GetOptionInt(wxIMAGE_OPTION_BMP_FORMAT
) == wxBMP_8BPP_PALETTE
)
179 unsigned char *cmap
= new unsigned char [256];
180 for ( int i
= 0; i
< 256; i
++ )
182 image
.SetPalette(wxPalette(256, cmap
, cmap
, cmap
));
188 wxString extension
= savefilename
.AfterLast('.').Lower();
190 if (extension
== _T("cur"))
192 image
.Rescale(32,32);
193 image
.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X
, 0);
194 image
.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y
, 0);
195 // This shows how you can save an image with explicitly
196 // specified image format:
197 loaded
= image
.SaveFile(savefilename
, wxBITMAP_TYPE_CUR
);
201 // This one guesses image format from filename extension
202 // (it may fail if the extension is not recognized):
203 loaded
= image
.SaveFile(savefilename
);
207 wxMessageBox(_T("No handler for this file type."),
208 _T("File was not saved"),
209 wxOK
|wxCENTRE
, this);
215 DECLARE_EVENT_TABLE()
220 class MyApp
: public wxApp
223 virtual bool OnInit();
232 IMPLEMENT_DYNAMIC_CLASS(MyCanvas
, wxScrolledWindow
)
234 BEGIN_EVENT_TABLE(MyImageFrame
, wxFrame
)
235 EVT_PAINT(MyImageFrame::OnPaint
)
236 EVT_LEFT_DCLICK(MyImageFrame::OnSave
)
239 BEGIN_EVENT_TABLE(MyCanvas
, wxScrolledWindow
)
240 EVT_PAINT(MyCanvas::OnPaint
)
243 MyCanvas::MyCanvas( wxWindow
*parent
, wxWindowID id
,
244 const wxPoint
&pos
, const wxSize
&size
)
245 : wxScrolledWindow( parent
, id
, pos
, size
, wxSUNKEN_BORDER
)
246 #if !defined(__WINDOWS__) || wxUSE_XPM_IN_MSW
247 , m_bmpSmileXpm((const char **) smile_xpm
)
248 , m_iconSmileXpm((const char **) smile_xpm
)
251 my_horse_png
= (wxBitmap
*) NULL
;
252 my_horse_jpeg
= (wxBitmap
*) NULL
;
253 my_horse_gif
= (wxBitmap
*) NULL
;
254 my_horse_bmp
= (wxBitmap
*) NULL
;
255 my_horse_bmp2
= (wxBitmap
*) NULL
;
256 my_horse_pcx
= (wxBitmap
*) NULL
;
257 my_horse_pnm
= (wxBitmap
*) NULL
;
258 my_horse_tiff
= (wxBitmap
*) NULL
;
259 my_horse_xpm
= (wxBitmap
*) NULL
;
260 my_horse_ico32
= (wxBitmap
*) NULL
;
261 my_horse_ico16
= (wxBitmap
*) NULL
;
262 my_horse_ico
= (wxBitmap
*) NULL
;
263 my_horse_cur
= (wxBitmap
*) NULL
;
265 my_smile_xbm
= (wxBitmap
*) NULL
;
266 my_square
= (wxBitmap
*) NULL
;
267 my_anti
= (wxBitmap
*) NULL
;
269 SetBackgroundColour(* wxWHITE
);
271 wxBitmap
bitmap( 100, 100 );
274 dc
.SelectObject( bitmap
);
275 dc
.SetBrush( wxBrush( wxT("orange"), wxSOLID
) );
276 dc
.SetPen( *wxBLACK_PEN
);
277 dc
.DrawRectangle( 0, 0, 100, 100 );
278 dc
.SetBrush( *wxWHITE_BRUSH
);
279 dc
.DrawRectangle( 20, 20, 60, 60 );
280 dc
.SelectObject( wxNullBitmap
);
282 // try to find the directory with our images
284 if ( wxFile::Exists(wxT("./horse.png")) )
286 else if ( wxFile::Exists(wxT("../horse.png")) )
289 wxLogWarning(wxT("Can't find image files in either '.' or '..'!"));
291 wxImage image
= bitmap
.ConvertToImage();
294 if ( !image
.SaveFile( dir
+ _T("test.png"), wxBITMAP_TYPE_PNG
))
295 wxLogError(wxT("Can't save file"));
299 image
.LoadFile( dir
+ _T("test.png") );
300 my_square
= new wxBitmap( image
);
304 if ( !image
.LoadFile( dir
+ _T("horse.png")) )
305 wxLogError(wxT("Can't load PNG image"));
307 my_horse_png
= new wxBitmap( image
);
308 #endif // wxUSE_LIBPNG
313 if ( !image
.LoadFile( dir
+ _T("horse.jpg")) )
314 wxLogError(wxT("Can't load JPG image"));
316 my_horse_jpeg
= new wxBitmap( image
);
317 #endif // wxUSE_LIBJPEG
322 if ( !image
.LoadFile( dir
+ wxString("horse.gif")))
323 wxLogError(wxT("Can't load GIF image"));
325 my_horse_gif
= new wxBitmap( image
);
331 if ( !image
.LoadFile( dir
+ _T("horse.pcx"), wxBITMAP_TYPE_PCX
) )
332 wxLogError(wxT("Can't load PCX image"));
334 my_horse_pcx
= new wxBitmap( image
);
339 if ( !image
.LoadFile( dir
+ _T("horse.bmp"), wxBITMAP_TYPE_BMP
) )
340 wxLogError(wxT("Can't load BMP image"));
342 my_horse_bmp
= new wxBitmap( image
);
347 if ( !image
.LoadFile( dir
+ _T("horse.xpm"), wxBITMAP_TYPE_XPM
) )
348 wxLogError(wxT("Can't load XPM image"));
350 my_horse_xpm
= new wxBitmap( image
);
352 if ( !image
.SaveFile( dir
+ _T("test.xpm"), wxBITMAP_TYPE_XPM
))
353 wxLogError(wxT("Can't save file"));
359 if ( !image
.LoadFile( dir
+ _T("horse.pnm"), wxBITMAP_TYPE_PNM
) )
360 wxLogError(wxT("Can't load PNM image"));
362 my_horse_pnm
= new wxBitmap( image
);
368 if ( !image
.LoadFile( dir
+ _T("horse.tif"), wxBITMAP_TYPE_TIF
) )
369 wxLogError(wxT("Can't load TIFF image"));
371 my_horse_tiff
= new wxBitmap( image
);
374 CreateAntiAliasedBitmap();
376 my_smile_xbm
= new wxBitmap( (const char*)smile_bits
, smile_width
,
379 #if !defined(__WINDOWS__) || wxUSE_XPM_IN_MSW
380 // demonstrates XPM automatically using the mask when saving
381 if ( m_bmpSmileXpm
.Ok() )
382 m_bmpSmileXpm
.SaveFile(_T("saved.xpm"), wxBITMAP_TYPE_XPM
);
388 if ( !image
.LoadFile( dir
+ _T("horse.ico"), wxBITMAP_TYPE_ICO
, 0 ) )
389 wxLogError(wxT("Can't load first ICO image"));
391 my_horse_ico32
= new wxBitmap( image
);
395 if ( !image
.LoadFile( dir
+ _T("horse.ico"), wxBITMAP_TYPE_ICO
, 1 ) )
396 wxLogError(wxT("Can't load second ICO image"));
398 my_horse_ico16
= new wxBitmap( image
);
402 if ( !image
.LoadFile( dir
+ _T("horse.ico") ) )
403 wxLogError(wxT("Can't load best ICO image"));
405 my_horse_ico
= new wxBitmap( image
);
409 if ( !image
.LoadFile( dir
+ _T("horse.cur"), wxBITMAP_TYPE_CUR
) )
410 wxLogError(wxT("Can't load best ICO image"));
413 my_horse_cur
= new wxBitmap( image
);
414 xH
= 30 + image
.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X
) ;
415 yH
= 2420 + image
.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y
) ;
421 // test image loading from stream
422 wxFile
file(dir
+ _T("horse.bmp"));
423 off_t len
= file
.Length();
424 void *data
= malloc(len
);
425 if ( file
.Read(data
, len
) != len
)
426 wxLogError(_T("Reading bitmap file failed"));
429 wxMemoryInputStream
mis(data
, len
);
430 if ( !image
.LoadFile(mis
) )
431 wxLogError(wxT("Can't load BMP image from stream"));
433 my_horse_bmp2
= new wxBitmap( image
);
439 MyCanvas::~MyCanvas()
443 delete my_horse_jpeg
;
446 delete my_horse_bmp2
;
448 delete my_horse_tiff
;
450 delete my_horse_ico32
;
451 delete my_horse_ico16
;
459 void MyCanvas::OnPaint( wxPaintEvent
&WXUNUSED(event
) )
461 wxPaintDC
dc( this );
464 dc
.DrawText( _T("Loaded image"), 30, 10 );
465 if (my_square
&& my_square
->Ok()) dc
.DrawBitmap( *my_square
, 30, 30 );
467 dc
.DrawText( _T("Drawn directly"), 150, 10 );
468 dc
.SetBrush( wxBrush( wxT("orange"), wxSOLID
) );
469 dc
.SetPen( *wxBLACK_PEN
);
470 dc
.DrawRectangle( 150, 30, 100, 100 );
471 dc
.SetBrush( *wxWHITE_BRUSH
);
472 dc
.DrawRectangle( 170, 50, 60, 60 );
474 if (my_anti
&& my_anti
->Ok())
475 dc
.DrawBitmap( *my_anti
, 280, 30 );
477 dc
.DrawText( _T("PNG handler"), 30, 135 );
478 if (my_horse_png
&& my_horse_png
->Ok())
480 dc
.DrawBitmap( *my_horse_png
, 30, 150 );
481 wxRect
rect(0,0,100,100);
482 wxBitmap
sub( my_horse_png
->GetSubBitmap(rect
) );
483 dc
.DrawText( _T("GetSubBitmap()"), 280, 190 );
484 dc
.DrawBitmap( sub
, 280, 210 );
487 dc
.DrawText( _T("JPEG handler"), 30, 365 );
488 if (my_horse_jpeg
&& my_horse_jpeg
->Ok())
489 dc
.DrawBitmap( *my_horse_jpeg
, 30, 380 );
491 dc
.DrawText( _T("GIF handler"), 30, 595 );
492 if (my_horse_gif
&& my_horse_gif
->Ok())
493 dc
.DrawBitmap( *my_horse_gif
, 30, 610 );
495 dc
.DrawText( _T("PCX handler"), 30, 825 );
496 if (my_horse_pcx
&& my_horse_pcx
->Ok())
497 dc
.DrawBitmap( *my_horse_pcx
, 30, 840 );
499 dc
.DrawText( _T("BMP handler"), 30, 1055 );
500 if (my_horse_bmp
&& my_horse_bmp
->Ok())
501 dc
.DrawBitmap( *my_horse_bmp
, 30, 1070 );
503 dc
.DrawText( _T("BMP read from memory"), 280, 1055 );
504 if (my_horse_bmp2
&& my_horse_bmp2
->Ok())
505 dc
.DrawBitmap( *my_horse_bmp2
, 280, 1070 );
507 dc
.DrawText( _T("PNM handler"), 30, 1285 );
508 if (my_horse_pnm
&& my_horse_pnm
->Ok())
509 dc
.DrawBitmap( *my_horse_pnm
, 30, 1300 );
511 dc
.DrawText( _T("TIFF handler"), 30, 1515 );
512 if (my_horse_tiff
&& my_horse_tiff
->Ok())
513 dc
.DrawBitmap( *my_horse_tiff
, 30, 1530 );
515 dc
.DrawText( _T("XPM handler"), 30, 1745 );
516 if (my_horse_xpm
&& my_horse_xpm
->Ok())
517 dc
.DrawBitmap( *my_horse_xpm
, 30, 1760 );
520 if (my_smile_xbm
&& my_smile_xbm
->Ok())
522 dc
.DrawText( _T("XBM bitmap"), 30, 1975 );
523 dc
.DrawText( _T("(green on red)"), 30, 1990 );
524 dc
.SetTextForeground( _T("GREEN") );
525 dc
.SetTextBackground( _T("RED") );
526 dc
.DrawBitmap( *my_smile_xbm
, 30, 2010 );
528 dc
.SetTextForeground( wxT("BLACK") );
529 dc
.DrawText( _T("After wxImage conversion"), 150, 1975 );
530 dc
.DrawText( _T("(red on white)"), 150, 1990 );
531 dc
.SetTextForeground( wxT("RED") );
532 wxImage i
= my_smile_xbm
->ConvertToImage();
533 i
.SetMaskColour( 255, 255, 255 );
535 wxRED_PEN
->GetColour().Red(),
536 wxRED_PEN
->GetColour().Green(),
537 wxRED_PEN
->GetColour().Blue() );
538 dc
.DrawBitmap( wxBitmap(i
), 150, 2010, TRUE
);
539 dc
.SetTextForeground( wxT("BLACK") );
543 wxBitmap
mono( 60,50,1 );
545 memdc
.SelectObject( mono
);
546 memdc
.SetPen( *wxBLACK_PEN
);
547 memdc
.SetBrush( *wxWHITE_BRUSH
);
548 memdc
.DrawRectangle( 0,0,60,50 );
549 memdc
.SetTextForeground( *wxBLACK
);
550 memdc
.DrawText( _T("Hi!"), 5, 5 );
551 memdc
.SetBrush( *wxBLACK_BRUSH
);
552 memdc
.DrawRectangle( 33,5,20,20 );
553 memdc
.SetPen( *wxRED_PEN
);
554 memdc
.DrawLine( 5, 42, 50, 42 );
555 memdc
.SelectObject( wxNullBitmap
);
559 dc
.DrawText( _T("Mono bitmap"), 30, 2095 );
560 dc
.DrawText( _T("(red on green)"), 30, 2110 );
561 dc
.SetTextForeground( wxT("RED") );
562 dc
.SetTextBackground( wxT("GREEN") );
563 dc
.DrawBitmap( mono
, 30, 2130 );
565 dc
.SetTextForeground( wxT("BLACK") );
566 dc
.DrawText( _T("After wxImage conversion"), 150, 2095 );
567 dc
.DrawText( _T("(red on white)"), 150, 2110 );
568 dc
.SetTextForeground( wxT("RED") );
569 wxImage i
= mono
.ConvertToImage();
570 i
.SetMaskColour( 255,255,255 );
572 wxRED_PEN
->GetColour().Red(),
573 wxRED_PEN
->GetColour().Green(),
574 wxRED_PEN
->GetColour().Blue() );
575 dc
.DrawBitmap( wxBitmap(i
), 150, 2130, TRUE
);
576 dc
.SetTextForeground( wxT("BLACK") );
579 dc
.DrawText(_T("XPM bitmap"), 30, 2230);
580 if ( m_bmpSmileXpm
.Ok() )
582 dc
.DrawBitmap(m_bmpSmileXpm
, 30, 2250, TRUE
);
585 dc
.DrawText(_T("XPM icon"), 150, 2230);
586 if ( m_iconSmileXpm
.Ok() )
588 dc
.DrawIcon(m_iconSmileXpm
, 150, 2250);
591 dc
.DrawText( _T("ICO handler (1st image)"), 30, 2290 );
592 if (my_horse_ico32
&& my_horse_ico32
->Ok())
593 dc
.DrawBitmap( *my_horse_ico32
, 30, 2330, TRUE
);
595 dc
.DrawText( _T("ICO handler (2nd image)"), 230, 2290 );
596 if (my_horse_ico16
&& my_horse_ico16
->Ok())
597 dc
.DrawBitmap( *my_horse_ico16
, 230, 2330, TRUE
);
599 dc
.DrawText( _T("ICO handler (best image)"), 430, 2290 );
600 if (my_horse_ico
&& my_horse_ico
->Ok())
601 dc
.DrawBitmap( *my_horse_ico
, 430, 2330, TRUE
);
603 dc
.DrawText( _T("CUR handler"), 30, 2390 );
604 if (my_horse_cur
&& my_horse_cur
->Ok())
606 dc
.DrawBitmap( *my_horse_cur
, 30, 2420, TRUE
);
607 dc
.SetPen (*wxRED_PEN
);
608 dc
.DrawLine (xH
-10,yH
,xH
+10,yH
);
609 dc
.DrawLine (xH
,yH
-10,xH
,yH
+10);
613 void MyCanvas::CreateAntiAliasedBitmap()
615 wxBitmap
bitmap( 300, 300 );
619 dc
.SelectObject( bitmap
);
623 dc
.SetFont( wxFont( 24, wxDECORATIVE
, wxNORMAL
, wxNORMAL
) );
624 dc
.SetTextForeground( wxT("RED") );
625 dc
.DrawText( _T("This is anti-aliased Text."), 20, 20 );
626 dc
.DrawText( _T("And a Rectangle."), 20, 60 );
628 dc
.SetBrush( *wxRED_BRUSH
);
629 dc
.SetPen( *wxTRANSPARENT_PEN
);
630 dc
.DrawRoundedRectangle( 20, 100, 200, 180, 20 );
632 wxImage original
= bitmap
.ConvertToImage();
633 wxImage
anti( 150, 150 );
635 /* This is quite slow, but safe. Use wxImage::GetData() for speed instead. */
637 for (int y
= 1; y
< 149; y
++)
638 for (int x
= 1; x
< 149; x
++)
640 int red
= original
.GetRed( x
*2, y
*2 ) +
641 original
.GetRed( x
*2-1, y
*2 ) +
642 original
.GetRed( x
*2, y
*2+1 ) +
643 original
.GetRed( x
*2+1, y
*2+1 );
646 int green
= original
.GetGreen( x
*2, y
*2 ) +
647 original
.GetGreen( x
*2-1, y
*2 ) +
648 original
.GetGreen( x
*2, y
*2+1 ) +
649 original
.GetGreen( x
*2+1, y
*2+1 );
652 int blue
= original
.GetBlue( x
*2, y
*2 ) +
653 original
.GetBlue( x
*2-1, y
*2 ) +
654 original
.GetBlue( x
*2, y
*2+1 ) +
655 original
.GetBlue( x
*2+1, y
*2+1 );
657 anti
.SetRGB( x
, y
, red
, green
, blue
);
659 my_anti
= new wxBitmap(anti
);
664 const int ID_QUIT
= 108;
665 const int ID_ABOUT
= 109;
666 const int ID_NEW
= 110;
668 IMPLEMENT_DYNAMIC_CLASS( MyFrame
, wxFrame
)
670 BEGIN_EVENT_TABLE(MyFrame
,wxFrame
)
671 EVT_MENU (ID_ABOUT
, MyFrame::OnAbout
)
672 EVT_MENU (ID_QUIT
, MyFrame::OnQuit
)
673 EVT_MENU (ID_NEW
, MyFrame::OnNewFrame
)
677 : wxFrame( (wxFrame
*)NULL
, -1, _T("wxImage sample"),
678 wxPoint(20,20), wxSize(470,360) )
680 wxMenu
*file_menu
= new wxMenu();
681 file_menu
->Append( ID_NEW
, _T("&Show image..."));
682 file_menu
->AppendSeparator();
683 file_menu
->Append( ID_ABOUT
, _T("&About..."));
684 file_menu
->AppendSeparator();
685 file_menu
->Append( ID_QUIT
, _T("E&xit"));
687 wxMenuBar
*menu_bar
= new wxMenuBar();
688 menu_bar
->Append(file_menu
, _T("&File"));
690 SetMenuBar( menu_bar
);
693 int widths
[] = { -1, 100 };
694 SetStatusWidths( 2, widths
);
696 m_canvas
= new MyCanvas( this, -1, wxPoint(0,0), wxSize(10,10) );
698 // 500 width * 2500 height
699 m_canvas
->SetScrollbars( 10, 10, 50, 250 );
702 void MyFrame::OnQuit( wxCommandEvent
&WXUNUSED(event
) )
707 void MyFrame::OnAbout( wxCommandEvent
&WXUNUSED(event
) )
709 (void)wxMessageBox( _T("wxImage demo\n")
710 _T("Robert Roebling (c) 1998,2000"),
711 _T("About wxImage Demo"), wxICON_INFORMATION
| wxOK
);
714 void MyFrame::OnNewFrame( wxCommandEvent
&WXUNUSED(event
) )
716 wxString filename
= wxFileSelector(_T("Select image file"));
721 if ( !image
.LoadFile(filename
) )
723 wxLogError(_T("Couldn't load image from '%s'."), filename
.c_str());
728 (new MyImageFrame(this, wxBitmap(image
)))->Show();
731 //-----------------------------------------------------------------------------
733 //-----------------------------------------------------------------------------
738 wxImage::AddHandler( new wxPNGHandler
);
742 wxImage::AddHandler( new wxJPEGHandler
);
746 wxImage::AddHandler( new wxTIFFHandler
);
750 wxImage::AddHandler( new wxGIFHandler
);
754 wxImage::AddHandler( new wxPCXHandler
);
758 wxImage::AddHandler( new wxPNMHandler
);
762 wxImage::AddHandler( new wxXPMHandler
);
766 wxImage::AddHandler( new wxICOHandler
);
767 wxImage::AddHandler( new wxCURHandler
);
770 wxFrame
*frame
= new MyFrame();