]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_stbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML resource for wxStaticBitmap
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_stbmp.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/xml/xh_stbmp.h"
23 #include "wx/statbmp.h"
25 #include "wx/bitmap.h"
27 wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler()
28 : wxXmlResourceHandler()
32 wxObject
*wxStaticBitmapXmlHandler::DoCreateResource()
34 wxImage
img(GetParamValue(_T("bitmap")));
35 wxSize sz
= GetSize();
37 if (!(sz
== wxDefaultSize
)) img
.Rescale(sz
.x
, sz
.y
);
39 wxStaticBitmap
*bmp
= new wxStaticBitmap(m_ParentAsWindow
,
41 img
.ConvertToBitmap(),
42 GetPosition(), GetSize(),
53 bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode
*node
)
55 return node
->GetName() == _T("staticbitmap");