wxStaticBitmap 没有名为 "SetScaleMode()" 的成员
wxStaticBitmap has no member named "SetScaleMode()"
对不起这个问题(可能很愚蠢),但是我很困惑:我尝试使用文档中所述的SetScaleMode()
在WXWIDGETS v3.0.2中缩放位图。尽管我的编译器(CCC遵循C 11)表示'class wxStaticBitmap' has no member named 'SetScaleMode'|
和'Scale_AspectFit' was not declared in this scope|
,但我使用了Incluble语句。也许我忽略了一些东西,下面是我的(缩短)代码:
#include <wx/msgdlg.h>
#include <wx/thread.h>
#include <wx/event.h>
#include <wx/statbmp.h>
//(*InternalHeaders(WindowsDgpsGUIFrame)
#include <wx/bitmap.h>
#include <wx/icon.h>
#include <wx/intl.h>
#include <wx/image.h>
#include <wx/string.h>
//*)
//wxTextFile file;
//helper functions
enum wxbuildinfoformat {
short_f, long_f };
wxString wxbuildinfo(wxbuildinfoformat format)
{
wxString wxbuild(wxVERSION_STRING);
if (format == long_f )
{
#if defined(__WXMSW__)
wxbuild << _T("-Windows");
#elif defined(__UNIX__)
wxbuild << _T("-Linux");
#endif
#if wxUSE_UNICODE
wxbuild << _T("-Unicode build");
#else
wxbuild << _T("-ANSI build");
#endif // wxUSE_UNICODE
}
return wxbuild;
}
//(*IdInit(WindowsDgpsGUIFrame)
const long WindowsDgpsGUIFrame::ID_STATICBITMAP1 = wxNewId();
const long WindowsDgpsGUIFrame::ID_PANEL1 = wxNewId();
BEGIN_EVENT_TABLE(WindowsDgpsGUIFrame,wxFrame)
//(*EventTable(WindowsDgpsGUIFrame)
//*)
END_EVENT_TABLE()
WindowsDgpsGUIFrame::WindowsDgpsGUIFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(WindowsDgpsGUIFrame)
wxBoxSizer* pBitmapBoxSizer;
wxBoxSizer* pPanelBoxSizer;
Create(parent, wxID_ANY, _("SensoRun"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxMAXIMIZE_BOX, _T("wxID_ANY"));
SetForegroundColour(wxColour(187,0,0));
SetBackgroundColour(wxColour(128,128,128));
{
wxIcon FrameIcon;
FrameIcon.CopyFromBitmap(wxBitmap(wxImage(_T(".\resources\sd.ico"))));
SetIcon(FrameIcon);
}
pPanel = new wxPanel(this, ID_PANEL1, wxPoint(280,352), wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
pPanelBoxSizer = new wxBoxSizer(wxVERTICAL);
pBitmapBoxSizer = new wxBoxSizer(wxVERTICAL);
StaticDirectionBitmap = new wxStaticBitmap(pPanel, ID_STATICBITMAP1, wxBitmap(wxImage(_T(".\resources\kein_pfeil.png"))), wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER, _T("ID_STATICBITMAP1"));
pBitmapBoxSizer->Add(StaticDirectionBitmap, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
pPanelBoxSizer->Add(pBitmapBoxSizer, 1, wxALL|wxEXPAND|wxFIXED_MINSIZE|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticDirectionBitmap->SetScaleMode(Scale_AspectFit);
}
(我希望我没有在此片段中删除一些重要的内容,我想让它更容易阅读)
您可以肯定地在链接到的文档中看到, wxStaticBitmap::SetScaleMode()
在使用 Since 3.1.0
,而当您使用" wxwidgets v3.0.2"时。因此,只需升级到正确的版本。
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 对RValue对象调用的LValue ref限定成员函数
- 为什么使用 "this" 指针调用派生成员函数?
- 具有奇怪重复模板模式的派生类中的成员变量已损坏
- 助记符和指向成员语法的指针
- 用于访问容器<T>数据成员的正确 API
- 内置函数可查看CPP中的成员变量
- 是否可以初始化不可复制类型的成员变量(或基类)
- 如果C++类在类方法中具有动态分配,但没有构造函数/析构函数或任何非静态成员,那么它仍然是POD类型吗
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 嵌套在类中时无法设置成员数据
- 为什么在没有显式默认构造函数的情况下,将另一个结构封装在联合中作为成员的结构不能编译
- 将函数类成员映射到类本身内部
- 基于另一个成员参数将函数调用从类传递给它的一个成员
- 将Ref对象作为类成员
- 将包含C样式数组的对象初始化为成员变量(C++)
- 静态数据成员的问题-修复链接错误会导致编译器错误
- 将公共但非静态的成员函数与ALGLIB集成
- 多成员Constexpr结构初始化
- wxStaticBitmap 没有名为 "SetScaleMode()" 的成员