git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5786
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size )
: wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER ),
MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size )
: wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER ),
- m_bmpSmileXpm(smile_xpm), m_iconSmileXpm(smile_xpm)
+ m_bmpSmileXpm((const char **) smile_xpm),
+ m_iconSmileXpm((const char **) smile_xpm)
{
my_horse_png = (wxBitmap*) NULL;
my_horse_jpeg = (wxBitmap*) NULL;
{
my_horse_png = (wxBitmap*) NULL;
my_horse_jpeg = (wxBitmap*) NULL;
// try to find the directory with our images
wxString dir;
if ( wxFile::Exists("./horse.png") )
// try to find the directory with our images
wxString dir;
if ( wxFile::Exists("./horse.png") )
else if ( wxFile::Exists("../horse.png") )
dir = "../";
else
else if ( wxFile::Exists("../horse.png") )
dir = "../";
else
my_horse_tiff = new wxBitmap( image.ConvertToBitmap() );
#endif
my_horse_tiff = new wxBitmap( image.ConvertToBitmap() );
#endif
- image.LoadFile( dir + wxString("test.png") );
+ image.LoadFile( dir + wxString("test.pcx") );
my_square = new wxBitmap( image.ConvertToBitmap() );
CreateAntiAliasedBitmap();
my_smile_xbm = new wxBitmap( (const char*)smile_bits, smile_width,
smile_height, 1 );
my_square = new wxBitmap( image.ConvertToBitmap() );
CreateAntiAliasedBitmap();
my_smile_xbm = new wxBitmap( (const char*)smile_bits, smile_width,
smile_height, 1 );
+
+ // demonstrates XPM automatically using the mask when saving
+ if ( m_bmpSmileXpm.Ok() )
+ m_bmpSmileXpm.SaveFile("saved.xpm", wxBITMAP_TYPE_XPM);
wxBitmap mono( 60,50,1 );
wxMemoryDC memdc;
memdc.SelectObject( mono );
wxBitmap mono( 60,50,1 );
wxMemoryDC memdc;
memdc.SelectObject( mono );
- memdc.SetPen( *wxTRANSPARENT_PEN );
+ memdc.SetPen( *wxBLACK_PEN );
memdc.SetBrush( *wxWHITE_BRUSH );
memdc.DrawRectangle( 0,0,60,50 );
memdc.SetTextForeground( *wxBLACK );
memdc.SetBrush( *wxWHITE_BRUSH );
memdc.DrawRectangle( 0,0,60,50 );
memdc.SetTextForeground( *wxBLACK );