几天来,我一直在尝试在wxWidgets对话框中显示内存中的骨形态发生蛋白图像,但没有一次成功。
首先,我尝试在对话框中创建一个wxStaticBitmap控件:
// in class declaration inside header file
wxStaticBitmap *ibitmap;
// in wxDialog constructor
// MyLogo is an array of `unsigned char`
// contains the bitmap file (Yes, the bitmap file, with BMP header)
ibitmap = n
我开始在一个项目中使用wxWidgets,并且我正在使用wxClientDc在图像上绘制。我创建了一个继承wxStaticBitmap的类,添加了我的属性并在其上绘制。要清除图像,我将背景设置为我在图像中使用的相同wxBitmap: //that is my class
class myImage : public wxStaticBitmap {
public:
wxBitmap frame; //imagem
myImage(wxWindow* parent, wxWindowID id, wxPoint pos, wxSiz
我正在尝试读取位图图像,并通过此构造函数使用类wxBitmap:
wxBitmap (const char bits[], int width, int height, int depth=1)
但是当我调用这个方法时,我不明白为什么:
wxDC::DrawBitmap (const wxBitmap &bitmap, wxCoord x, wxCoord y, bool useMask=false)
图像完全失真了。
代码如下:
wxBitmap*
MyFrame::readImage(const char* filename, int x, int y)
{
char* b