コード例 #1
0
void GCDCGraphs::DrawRemarksBitmaps(wxGraphicsContext &dc) {
	Draw* draw = m_draws_wdg->GetSelectedDraw();
	if (draw == NULL)
		return;

	const ValuesTable& vt = draw->GetValuesTable();
	for (size_t i = 0; i < draw->GetValuesTable().size(); i++)
		if (vt.at(i).m_remark) { 
			double x = GetX(i);
			dc.DrawBitmap(m_remark_flag_bitmap,
					x - m_remark_flag_bitmap.GetWidth() / 2,
					m_screen_margins.topmargin - 7,
					m_remark_flag_bitmap.GetWidth(),
					m_remark_flag_bitmap.GetHeight());
		}
}
コード例 #2
0
ファイル: PDFViewPages.cpp プロジェクト: amitdo/wxPDFView
void wxPDFViewPage::Draw(wxPDFViewPagesClient* client, wxDC& dc, wxGraphicsContext& gc, const wxRect& rect)
{
	// Calculate the required bitmap size
	wxSize bmpSize = rect.GetSize();
	double scaleX, scaleY;
	dc.GetUserScale(&scaleX, &scaleY);
	bmpSize.x *= scaleX;
	bmpSize.y *= scaleY;

	double screenScale = dc.GetContentScaleFactor();
	bmpSize.x *= screenScale;
	bmpSize.y *= screenScale;

	wxBitmap bmp = client->GetCachedBitmap(m_index, bmpSize);
	if (bmp.IsOk())
	{
		gc.DrawBitmap(bmp, rect.x, rect.y, rect.width, rect.height);
	} else {
		// Draw empty page
		gc.SetBrush(*wxWHITE_BRUSH);
		gc.SetPen(wxNullPen);
		gc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
	}
}