+// ----------------------------------------------------------------------------
+// global functions
+// ----------------------------------------------------------------------------
+
+static void ShowBitmap(const wxBitmap& bitmap)
+{
+ wxFrame *frame = new wxFrame(NULL, -1, _T("Bitmap view"));
+ frame->CreateStatusBar();
+ DnDCanvasBitmap *canvas = new DnDCanvasBitmap(frame);
+ canvas->SetBitmap(bitmap);
+
+ int w = bitmap.GetWidth(),
+ h = bitmap.GetHeight();
+ frame->SetStatusText(wxString::Format(_T("%dx%d"), w, h));
+
+ frame->SetClientSize(w > 100 ? 100 : w, h > 100 ? 100 : h);
+ frame->Show(TRUE);
+}
+
+#ifdef USE_METAFILES
+
+static void ShowMetaFile(const wxMetaFile& metafile)
+{
+ wxFrame *frame = new wxFrame(NULL, -1, _T("Metafile view"));
+ frame->CreateStatusBar();
+ DnDCanvasMetafile *canvas = new DnDCanvasMetafile(frame);
+ canvas->SetMetafile(metafile);
+
+ wxSize size = metafile.GetSize();
+ frame->SetStatusText(wxString::Format(_T("%dx%d"), size.x, size.y));
+
+ frame->SetClientSize(size.x > 100 ? 100 : size.x,
+ size.y > 100 ? 100 : size.y);
+ frame->Show();
+}
+
+#endif // USE_METAFILES