TIFF change 6.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4729 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-11-28 17:21:03 +00:00
parent 1c8d8d21dc
commit 60a41aee69

View File

@@ -44,9 +44,11 @@ public:
wxBitmap *my_horse_bmp; wxBitmap *my_horse_bmp;
wxBitmap *my_horse_pcx; wxBitmap *my_horse_pcx;
wxBitmap *my_horse_pnm; wxBitmap *my_horse_pnm;
wxBitmap *my_horse_tiff;
wxBitmap *my_square; wxBitmap *my_square;
wxBitmap *my_anti; wxBitmap *my_anti;
private:
DECLARE_DYNAMIC_CLASS(MyCanvas) DECLARE_DYNAMIC_CLASS(MyCanvas)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
@@ -63,6 +65,7 @@ public:
MyCanvas *m_canvas; MyCanvas *m_canvas;
private:
DECLARE_DYNAMIC_CLASS(MyFrame) DECLARE_DYNAMIC_CLASS(MyFrame)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
@@ -97,6 +100,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
my_horse_bmp = (wxBitmap*) NULL; my_horse_bmp = (wxBitmap*) NULL;
my_horse_pcx = (wxBitmap*) NULL; my_horse_pcx = (wxBitmap*) NULL;
my_horse_pnm = (wxBitmap*) NULL; my_horse_pnm = (wxBitmap*) NULL;
my_horse_tiff = (wxBitmap*) NULL;
my_square = (wxBitmap*) NULL; my_square = (wxBitmap*) NULL;
my_anti = (wxBitmap*) NULL; my_anti = (wxBitmap*) NULL;
@@ -161,6 +165,13 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
my_horse_pnm = new wxBitmap( image.ConvertToBitmap() ); my_horse_pnm = new wxBitmap( image.ConvertToBitmap() );
#endif #endif
#if wxUSE_LIBTIFF
if ( !image.LoadFile( dir + wxString("horse.tif"), wxBITMAP_TYPE_TIF ) )
wxLogError("Can't load TIFF image");
else
my_horse_tiff = new wxBitmap( image.ConvertToBitmap() );
#endif
image.LoadFile( dir + wxString("test.png") ); image.LoadFile( dir + wxString("test.png") );
my_square = new wxBitmap( image.ConvertToBitmap() ); my_square = new wxBitmap( image.ConvertToBitmap() );
@@ -175,6 +186,7 @@ MyCanvas::~MyCanvas()
delete my_horse_gif; delete my_horse_gif;
delete my_horse_bmp; delete my_horse_bmp;
delete my_horse_pcx; delete my_horse_pcx;
delete my_horse_tiff;
delete my_square; delete my_square;
delete my_anti; delete my_anti;
} }
@@ -211,6 +223,9 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.DrawText( "PNM handler", 30, 1285 ); dc.DrawText( "PNM handler", 30, 1285 );
if (my_horse_pnm && my_horse_pnm->Ok()) dc.DrawBitmap( *my_horse_pnm, 30, 1300 ); if (my_horse_pnm && my_horse_pnm->Ok()) dc.DrawBitmap( *my_horse_pnm, 30, 1300 );
dc.DrawText( "TIFF handler", 30, 1415 );
if (my_horse_tiff && my_horse_tiff->Ok()) dc.DrawBitmap( *my_horse_pnm, 30, 1430 );
} }
void MyCanvas::CreateAntiAliasedBitmap() void MyCanvas::CreateAntiAliasedBitmap()
@@ -294,7 +309,7 @@ MyFrame::MyFrame()
m_canvas = new MyCanvas( this, -1, wxPoint(0,0), wxSize(10,10) ); m_canvas = new MyCanvas( this, -1, wxPoint(0,0), wxSize(10,10) );
// 500 width * 1300 height // 500 width * 1300 height
m_canvas->SetScrollbars( 10, 10, 50, 152 ); m_canvas->SetScrollbars( 10, 10, 50, 180 );
} }
void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) ) void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
@@ -324,6 +339,10 @@ bool MyApp::OnInit()
wxImage::AddHandler( new wxJPEGHandler ); wxImage::AddHandler( new wxJPEGHandler );
#endif #endif
#if wxUSE_LIBTIFF
wxImage::AddHandler( new wxTIFFHandler );
#endif
#if wxUSE_GIF #if wxUSE_GIF
wxImage::AddHandler( new wxGIFHandler ); wxImage::AddHandler( new wxGIFHandler );
#endif #endif