当前位置: 首页>>代码示例>>C++>>正文


C++ wxPaintDC::Clear方法代码示例

本文整理汇总了C++中wxPaintDC::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ wxPaintDC::Clear方法的具体用法?C++ wxPaintDC::Clear怎么用?C++ wxPaintDC::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxPaintDC的用法示例。


在下文中一共展示了wxPaintDC::Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawSlider

void SliderPanel::DrawSlider(wxPaintDC &dc)
{
	wxColour color;
	color.Set(wxT("#DDE1E6"));
	dc.SetBackground(wxBrush(color));
	dc.Clear();

	wxSize size = GetSize();
	int width = size.GetWidth();
	int height = size.GetHeight();

	wxSize size2 = m_slider->GetSize();
	int width2 = size2.GetWidth();
	int height2 = size2.GetHeight();

	int x = (width-width2)/2;
	int y = (height-height2)/2;

	m_slider->Move(wxPoint(x,y));
}
开发者ID:ktd2004,项目名称:imsplayer,代码行数:20,代码来源:SliderPanel.cpp

示例2: Paint

bool THISCLASS::Paint(wxPaintDC &dc) {
	// Get timeline
	const SwisTrackCoreEventRecorder::Timeline *timeline = mSwisTrack->mSwisTrackCore->mEventRecorder->GetLastTimeline();
	if (timeline == 0) {
		return false;
	}

	// Draw background
	dc.SetBackground(wxBrush(wxColour(0xff, 0xff, 0xff)));
	dc.Clear();

	// Draw
	DrawTrigger(dc, timeline);
	DrawTicks(dc, timeline);
	DrawComponentSteps(dc, timeline);
	DrawStepLapTimes(dc, timeline);
	DrawSteps(dc, timeline);
	DrawStartStop(dc, timeline);
	DrawBeginEnd(dc, timeline);
	DrawTimelineOverflow(dc, timeline);

	return true;
}
开发者ID:dtbinh,项目名称:swistrackplus,代码行数:23,代码来源:TimelinePanel.cpp

示例3: OnSized

void PeakMeter::OnSized( wxPaintDC& dc )
{
	m_colorBack.Set(wxT("#DDE1E6"));
	dc.SetBackground(wxBrush(m_colorBack));
	dc.Clear();

	wxRect rc = GetClientRect();

	int rw = rc.GetWidth();
	int rh = rc.GetHeight();

	// draw meter
	wxBitmap bmp = wxGetBitmapFromMemory(meter_bmp, sizeof(meter_bmp));
	int bw = bmp.GetWidth();
	int bh = bmp.GetHeight();

	m_meterBitmapX = (rw-bw)/2;
	m_meterBitmapY = (rh-bh)/2;
	dc.DrawBitmap(bmp, m_meterBitmapX, m_meterBitmapY, true);

	// draw repeat button
	int x = m_meterBitmapX+20;

	if ( m_repeatButton == NULL )
	{
		wxBitmap bmp1 = wxGetBitmapFromMemory(repeat_all_bmp,
											  sizeof(repeat_all_bmp));
		wxBitmap bmp2 = wxGetBitmapFromMemory(repeat_all_hover_bmp,
											  sizeof(repeat_all_hover_bmp));
		m_repeatButton= new GButton(this, wxID_ANY,
									wxDefaultPosition, bmp1, bmp2);
		m_repeatButton->SetToolTip(wxT("Choose Repeat mode (Repeat All)"));
		Connect(m_repeatButton->GetId(), wxEVT_COMMAND_GBUTTON,
				(wxObjectEventFunction) (wxEventFunction) &PeakMeter::OnRepeat);
	}
	m_repeatButton->Move(x, m_meterBitmapY+25);

	if ( m_playModeButton == NULL )
	{
		wxBitmap bmp1 = wxGetBitmapFromMemory(play_mode_normal_bmp,
											  sizeof(play_mode_normal_bmp));
		wxBitmap bmp2 = wxGetBitmapFromMemory(play_mode_normal_hover_bmp,
											  sizeof(play_mode_normal_hover_bmp));
		m_playModeButton= new GButton(this, wxID_ANY,
									  wxDefaultPosition, bmp1, bmp2);
		m_playModeButton->SetToolTip(wxT("Choose Play mode"));
	}
	m_playModeButton->Move(x, m_meterBitmapY+45);

	// draw convert button
	bmp = wxGetBitmapFromMemory(button_bmp, sizeof(button_bmp));
	int bw2 = bmp.GetWidth();
	bh = bmp.GetHeight();

	x = m_meterBitmapX-bw2-10;
	if ( m_convertButton == NULL )
	{
		wxBitmap bmp1 = wxGetBitmapFromMemory(convert_bmp,
											  sizeof(convert_bmp));
		wxBitmap bmp2 = wxGetBitmapFromMemory(convert_hover_bmp,
											  sizeof(convert_hover_bmp));
		wxBitmap bmp3 = wxGetBitmapFromMemory(convert_clicked_bmp,
											  sizeof(convert_clicked_bmp));
		m_convertButton= new GButton(this, wxID_ANY,
									 wxDefaultPosition, bmp1, bmp2, bmp3);
	}
	m_convertButton->Move(x, m_meterBitmapY+5);

	dc.DrawBitmap(bmp, x, m_meterBitmapY+40, true);

	x = m_meterBitmapX+bw+10;
	dc.DrawBitmap(bmp, x, m_meterBitmapY+5, true);
	dc.DrawBitmap(bmp, x, m_meterBitmapY+40, true);
}
开发者ID:sopepos,项目名称:imsplayer_osx,代码行数:74,代码来源:PeakMeter.cpp


注:本文中的wxPaintDC::Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。