+ dc.DrawText( "BMP handler", 30, 1055 );
+ if (my_horse_bmp && my_horse_bmp->Ok())
+ dc.DrawBitmap( *my_horse_bmp, 30, 1070 );
+
+ dc.DrawText( "PNM handler", 30, 1285 );
+ if (my_horse_pnm && my_horse_pnm->Ok())
+ dc.DrawBitmap( *my_horse_pnm, 30, 1300 );
+
+ dc.DrawText( "TIFF handler", 30, 1515 );
+ if (my_horse_tiff && my_horse_tiff->Ok())
+ dc.DrawBitmap( *my_horse_tiff, 30, 1530 );
+
+ if (my_smile_xbm && my_smile_xbm->Ok())
+ {
+ dc.DrawText( "XBM bitmap", 30, 1745 );
+ dc.SetTextForeground( "RED" );
+ dc.SetTextBackground( "GREEN" );
+ dc.DrawBitmap( *my_smile_xbm, 30, 1760 );
+
+ dc.DrawText( "After wxImage conversion", 150, 1745 );
+ wxImage i( *my_smile_xbm );
+ i.SetMaskColour( 0,0,0 );
+ i.Replace( 255,255,255,
+ wxRED_PEN->GetColour().Red(),
+ wxRED_PEN->GetColour().Green(),
+ wxRED_PEN->GetColour().Blue() );
+ dc.DrawBitmap( i.ConvertToBitmap(), 150, 1760, TRUE );
+ }
+ dc.SetTextForeground( "BLACK" );
+
+ wxBitmap mono( 60,50,1 );
+ wxMemoryDC memdc;
+ memdc.SelectObject( mono );
+ memdc.SetPen( *wxBLACK_PEN );
+ memdc.SetBrush( *wxWHITE_BRUSH );
+ memdc.DrawRectangle( 0,0,60,50 );
+ memdc.SetTextForeground( *wxBLACK );
+ memdc.DrawText( "Hi!", 5, 5 );
+ memdc.SetBrush( *wxBLACK_BRUSH );
+ memdc.DrawRectangle( 33,5,20,20 );
+ memdc.SetPen( *wxRED_PEN );
+ memdc.DrawLine( 5, 42, 50, 42 );
+ memdc.SelectObject( wxNullBitmap );
+ if (mono.Ok())
+ {
+ dc.DrawText( "Mono bitmap", 30, 1845 );
+ dc.SetTextForeground( "RED" );
+ dc.SetTextBackground( "GREEN" );
+ dc.DrawBitmap( mono, 30, 1860 );
+
+ dc.SetTextForeground( "BLACK" );
+ dc.DrawText( "After wxImage conversion", 150, 1845 );
+ dc.SetTextForeground( "RED" );
+ wxImage i( mono );
+ i.SetMaskColour( 255,255,255 );
+ i.Replace( 0,0,0,
+ wxRED_PEN->GetColour().Red(),
+ wxRED_PEN->GetColour().Green(),
+ wxRED_PEN->GetColour().Blue() );
+ dc.DrawBitmap( i.ConvertToBitmap(), 150, 1860, TRUE );
+ dc.SetTextForeground( "BLACK" );
+ }
+
+ dc.DrawText("XPM bitmap", 30, 1950);
+ if ( m_bmpSmileXpm.Ok() )
+ {
+ dc.DrawBitmap(m_bmpSmileXpm, 30, 1975, TRUE);
+ }
+
+ dc.DrawText("XPM icon", 150, 1950);
+ if ( m_iconSmileXpm.Ok() )
+ {
+ dc.DrawIcon(m_iconSmileXpm, 150, 1975);
+ }