From bf504f980a2ab2e44ad20efe1f94292943d0dfae Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 2 Feb 2002 23:16:09 +0000 Subject: [PATCH] added cur and ico formats to the sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/image/Makefile.in | 3 +- samples/image/horse.cur | Bin 0 -> 326 bytes samples/image/horse.ico | Bin 0 -> 1078 bytes samples/image/image.cpp | 99 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 samples/image/horse.cur create mode 100644 samples/image/horse.ico diff --git a/samples/image/Makefile.in b/samples/image/Makefile.in index 347cec4f91..3cf0907803 100644 --- a/samples/image/Makefile.in +++ b/samples/image/Makefile.in @@ -13,7 +13,8 @@ top_srcdir = @top_srcdir@/.. top_builddir = ../.. program_dir = samples/image -DATAFILES = horse.png horse.jpg horse.bmp horse.gif horse.pcx horse.pnm horse.tif horse.xpm smile.xbm +DATAFILES = horse.png horse.jpg horse.bmp horse.gif horse.pcx horse.pnm \ + horse.tif horse.xpm smile.xbm horse.cur horse.ico PROGRAM=image diff --git a/samples/image/horse.cur b/samples/image/horse.cur new file mode 100644 index 0000000000000000000000000000000000000000..9f992f9de1072fd9e38f5d5cecb469e0a60c471b GIT binary patch literal 326 zcmcJ}Aritc5QX8FMyw19WGj)}Al$4y8b{#{F-*#Zq2_}nizzg!VWESwddmT9j>qJ{+V6wxP@a1cM29RtDd@5 T=@;XMc_Z75F=OpT!2{$2P)bYv literal 0 HcmV?d00001 diff --git a/samples/image/horse.ico b/samples/image/horse.ico new file mode 100644 index 0000000000000000000000000000000000000000..c9e5d972687175c22925df82633e8417f7da5609 GIT binary patch literal 1078 zcma)4Ic~!+5FD8S%qsQ+f=E^1QUDuw%FjfA4S$iZD99_)rF7{s2m&*+OHmhGWaS}e zPZQ(-6?SNvBg8H{;D!6~nEg`)JR0D{SVO!L6&|<(p0)SQGs%qidE-ioVHmheBIyq) z2_yJPNS0#$T$t{*HBpFH51?a&+tC-U9YV&i`gx2-l`gvGRM4jEa~+3j6RfwHl>a{G zYVcN8R*q7FJmS*yj~9Wh@BAW3dS3e`pKhvgoAI0Wd|N=vdy<~nH;yrsb|+@qDIbGI zP{u_u7pBu#4TRRqP&EmJQZ5meg!N%#SRXbfJ0C2pd+fp{lAQ#x_5D8C_!&Ij`Q=CdHF zX)=Nz$$xcj`4FYgvR_|I0`h9|NRnO3Bo|Hk%z~dwB;E2YOk()) dc.DrawBitmap( *my_horse_xpm, 30, 1760 ); + if (my_smile_xbm && my_smile_xbm->Ok()) { dc.DrawText( "XBM bitmap", 30, 1975 ); @@ -505,6 +568,27 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) { dc.DrawIcon(m_iconSmileXpm, 150, 2250); } + + dc.DrawText( "ICO handler (1st image)", 30, 2290 ); + if (my_horse_ico32 && my_horse_ico32->Ok()) + dc.DrawBitmap( *my_horse_ico32, 30, 2330, TRUE ); + + dc.DrawText( "ICO handler (2nd image)", 230, 2290 ); + if (my_horse_ico16 && my_horse_ico16->Ok()) + dc.DrawBitmap( *my_horse_ico16, 230, 2330, TRUE ); + + dc.DrawText( "ICO handler (best image)", 430, 2290 ); + if (my_horse_ico && my_horse_ico->Ok()) + dc.DrawBitmap( *my_horse_ico, 430, 2330, TRUE ); + + dc.DrawText( "CUR handler", 30, 2390 ); + if (my_horse_cur && my_horse_cur->Ok()) + { + dc.DrawBitmap( *my_horse_cur, 30, 2420, TRUE ); + dc.SetPen (*wxRED_PEN); + dc.DrawLine (xH-10,yH,xH+10,yH); + dc.DrawLine (xH,yH-10,xH,yH+10); + } } void MyCanvas::CreateAntiAliasedBitmap() @@ -592,8 +676,8 @@ MyFrame::MyFrame() m_canvas = new MyCanvas( this, -1, wxPoint(0,0), wxSize(10,10) ); - // 500 width * 2100 height - m_canvas->SetScrollbars( 10, 10, 50, 220 ); + // 500 width * 2500 height + m_canvas->SetScrollbars( 10, 10, 50, 250 ); } void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) ) @@ -659,6 +743,11 @@ bool MyApp::OnInit() wxImage::AddHandler( new wxXPMHandler ); #endif +#if wxUSE_ICO_CUR + wxImage::AddHandler( new wxICOHandler ); + wxImage::AddHandler( new wxCURHandler ); +#endif + wxFrame *frame = new MyFrame(); frame->Show( TRUE ); -- 2.45.2