]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/image/canvas.cpp
Deprecate old style wxPanel ctor taking separate coordinates.
[wxWidgets.git] / samples / image / canvas.cpp
index 4f370f6b47b64e60f5dc8727db483d9f439caba0..5b98dcf07b0376a16f52e658f3c8a8ffb397f976 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     1998
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998-2005 Robert Roebling
-// License:     wxWindows licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -641,22 +641,22 @@ void MyCanvas::CreateAntiAliasedBitmap()
 {
     wxBitmap bitmap( 300, 300 );
 
-    wxMemoryDC dc;
-
-    dc.SelectObject( bitmap );
+    {
+        wxMemoryDC dc(bitmap);
 
-    dc.Clear();
+        dc.Clear();
 
-    dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL) );
-    dc.SetTextForeground( wxT("RED") );
-    dc.DrawText( wxT("This is anti-aliased Text."), 20, 5 );
-    dc.DrawText( wxT("And a Rectangle."), 20, 45 );
+        dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL) );
+        dc.SetTextForeground( wxT("RED") );
+        dc.DrawText( wxT("This is anti-aliased Text."), 20, 5 );
+        dc.DrawText( wxT("And a Rectangle."), 20, 45 );
 
-    dc.SetBrush( *wxRED_BRUSH );
-    dc.SetPen( *wxTRANSPARENT_PEN );
-    dc.DrawRoundedRectangle( 20, 85, 200, 180, 20 );
+        dc.SetBrush( *wxRED_BRUSH );
+        dc.SetPen( *wxTRANSPARENT_PEN );
+        dc.DrawRoundedRectangle( 20, 85, 200, 180, 20 );
+    }
 
-    wxImage original= bitmap.ConvertToImage();
+    wxImage original = bitmap.ConvertToImage();
     wxImage anti( 150, 150 );
 
     /* This is quite slow, but safe. Use wxImage::GetData() for speed instead. */