X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5ac656c5a220c129347e059e1fc656b00ac55d4..0141d2c9bd1033b773847447029f4598b7d9e90e:/samples/rotate/rotate.cpp diff --git a/samples/rotate/rotate.cpp b/samples/rotate/rotate.cpp index 3319489b51..5ab6b68b92 100644 --- a/samples/rotate/rotate.cpp +++ b/samples/rotate/rotate.cpp @@ -22,7 +22,14 @@ #include "wx/image.h" +/* GRG: This is not ANSI standard, define M_PI explicitly #include // M_PI +*/ + +#ifndef M_PI +#define M_PI 3.1415926535897932384626433832795 +#endif + class MyApp: public wxApp { @@ -71,6 +78,10 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { m_image = wxImage("kclub.bmp", wxBITMAP_TYPE_BMP); + + // any unused colour will do + m_image.SetMaskColour( 0, 255, 255 ); + if ( !m_image.Ok() ) { wxLogError("Can't load the test image, please copy it to the " @@ -82,7 +93,7 @@ bool MyApp::OnInit() wxPoint(20,20), wxSize(600,450)); frame->SetBackgroundColour (wxColour (0,80,60)); - + frame->Clear(); frame->Show (TRUE); SetTopWindow (frame); return TRUE; @@ -132,7 +143,7 @@ void MyFrame::OnMouseLeftUp (wxMouseEvent & event) wxBitmap bmp = img2.ConvertToBitmap (); wxClientDC dc (this); - dc.DrawBitmap (img2.ConvertToBitmap(), event.m_x + offset.x, event.m_y + offset.y); + dc.DrawBitmap (img2.ConvertToBitmap(), event.m_x + offset.x, event.m_y + offset.y, TRUE); } // without interpolation, and without offset correction @@ -144,5 +155,5 @@ void MyFrame::OnMouseRightUp (wxMouseEvent & event) wxBitmap bmp = img2.ConvertToBitmap (); wxClientDC dc (this); - dc.DrawBitmap (bmp, event.m_x, event.m_y); + dc.DrawBitmap (bmp, event.m_x, event.m_y, TRUE); }