X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526954c5968baa29218c994ec48e476ae2bd4b9f..74518cea410bc1d8dc8438e81199572eac145a96:/samples/image/canvas.cpp?ds=sidebyside diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 93b6a68973..5b98dcf07b 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -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. */