From b2177839039eaeb7ca5f9b55f44a054c8684fb4f Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Thu, 10 Feb 2000 13:26:30 +0000 Subject: [PATCH] Added code to test the transparency stuff for image rotation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/rotate/rotate.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/samples/rotate/rotate.cpp b/samples/rotate/rotate.cpp index 4b309651bd..5ab6b68b92 100644 --- a/samples/rotate/rotate.cpp +++ b/samples/rotate/rotate.cpp @@ -78,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 " @@ -89,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; @@ -139,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 @@ -151,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); } -- 2.47.2