]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/image/image.cpp
Minor changes, just trim trailing spaces in webview code.
[wxWidgets.git] / samples / image / image.cpp
index c35f99173776637527929e7c2fb5630ca70731d4..28afeb1d1fcb8648e3a88edf72e6b0003313664f 100644 (file)
@@ -50,7 +50,7 @@
 
 #include "canvas.h"
 
 
 #include "canvas.h"
 
-#ifndef __WXMSW__
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
     #include "../sample.xpm"
 #endif
 
@@ -668,7 +668,7 @@ MyFrame::MyFrame()
     menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"),
                         "Test scaling the image during load (try with JPEG)");
     menuImage->AppendSeparator();
     menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"),
                         "Test scaling the image during load (try with JPEG)");
     menuImage->AppendSeparator();
-    menuImage->Append( ID_ABOUT, wxT("&About...\tF1"));
+    menuImage->Append( ID_ABOUT, wxT("&About\tF1"));
     menuImage->AppendSeparator();
     menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q"));
     menu_bar->Append(menuImage, wxT("&Image"));
     menuImage->AppendSeparator();
     menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q"));
     menu_bar->Append(menuImage, wxT("&Image"));
@@ -866,10 +866,11 @@ private:
         wxGraphicsBitmap gb(gc->CreateBitmapFromImage(m_image));
 
         gc->SetFont(*wxNORMAL_FONT, *wxBLACK);
         wxGraphicsBitmap gb(gc->CreateBitmapFromImage(m_image));
 
         gc->SetFont(*wxNORMAL_FONT, *wxBLACK);
-
         gc->DrawText("Bitmap", 0, HEIGHT/2);
         gc->DrawBitmap(m_bitmap, 0, 0, WIDTH, HEIGHT);
 
         gc->DrawText("Bitmap", 0, HEIGHT/2);
         gc->DrawBitmap(m_bitmap, 0, 0, WIDTH, HEIGHT);
 
+        wxGraphicsFont gf = gc->CreateFont(wxNORMAL_FONT->GetPixelSize().y, "");
+        gc->SetFont(gf);
         gc->DrawText("Graphics bitmap", 0, (3*HEIGHT)/2);
         gc->DrawBitmap(gb, 0, HEIGHT, WIDTH, HEIGHT);
     }
         gc->DrawText("Graphics bitmap", 0, (3*HEIGHT)/2);
         gc->DrawBitmap(gb, 0, HEIGHT, WIDTH, HEIGHT);
     }
@@ -943,10 +944,14 @@ void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
         return;
     }
 
         return;
     }
 
+    int origWidth = image.GetOptionInt( wxIMAGE_OPTION_ORIGINAL_WIDTH );
+    int origHeight = image.GetOptionInt( wxIMAGE_OPTION_ORIGINAL_HEIGHT );
+
     const long loadTime = sw.Time();
 
     MyImageFrame * const frame = new MyImageFrame(this, filename, image);
     const long loadTime = sw.Time();
 
     MyImageFrame * const frame = new MyImageFrame(this, filename, image);
-    wxLogStatus(frame, "Loaded \"%s\" in %ldms", filename, loadTime);
+    wxLogStatus(frame, "Loaded \"%s\" in %ldms; original size was (%d, %d)",
+                filename, loadTime, origWidth, origHeight);
 #else
     wxLogError( wxT("Couldn't create file selector dialog") );
     return;
 #else
     wxLogError( wxT("Couldn't create file selector dialog") );
     return;