Esempio n. 1
0
void gqbView::SaveAsImage(const wxString &fileName, wxBitmapType imgType)
{

	updateModelSize(NULL, true);

	if (modelSize.GetWidth() == 0 || modelSize.GetHeight() == 0)
	{
		wxMessageBox(_("Nothing to be saved!"), _("Save As an image"), wxOK | wxICON_INFORMATION);
		return;
	}

	int width = 0, height = 0;
	GetVirtualSize(&width, &height);

	/*
	* Create the bitmap from the Explain window
	*/
	wxMemoryDC memDC;
	wxBitmap tempBitmap(width, height);

	memDC.SelectObject(tempBitmap);
	memDC.Clear();

	// Draw the diagram on the bitmap (Memory Device Context)
	drawAll(memDC, false);

	memDC.SelectObject(wxNullBitmap);

	if (!tempBitmap.SaveFile(fileName, imgType))
	{
		wxLogError(_("Could not write the file %s: Errcode=%d."), fileName.c_str(), wxSysErrorCode());
	}
}
Esempio n. 2
0
bool gqbView::canSaveAsImage()
{
	updateModelSize(NULL, true);
	return !(modelSize.GetWidth() == 0 || modelSize.GetHeight() == 0);
}
Esempio n. 3
0
void gqbView::OnRefresh(wxCommandEvent &ev)
{
	updateModelSize(NULL, true);
	this->Update();
}
Esempio n. 4
0
void gqbView::OnSize(wxSizeEvent &event)
{
	updateModelSize(NULL, true);
}
void bimWorld::CameraManipulator::updateModelSize()
{
	auto manip = dynamic_cast<bimWorld::BIMCameraManipulator*>(getCameraManipulator());
	manip->updateModelSize();
}