コード例 #1
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
void EditView::SetOffset( Point const& projpos )
{
    m_Offset = projpos;
    ConfineView();
    DrawView(m_ViewBox);
    Redraw(m_ViewBox);
}
コード例 #2
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
void EditView::Resize( int w, int h )
{
    if(m_Canvas)
    {
        delete m_Canvas;
        m_Canvas = 0;
    }

    m_ViewBox.w = w;
    m_ViewBox.h = h;

    m_Canvas = new Img( FMT_RGBX8, w,h );
    ConfineView();

    // if view is wider/taller than image, center it
    Box const& p = Proj().ImgConst(Frame()).Bounds();
    Box v = ViewToProj( m_ViewBox );
    if( v.w>p.w)
        m_Offset.x = -(v.w - p.w) / 2;
    if( v.h>p.h)
        m_Offset.y = -(v.h - p.h) / 2;

    DrawView(m_ViewBox);
    Redraw(m_ViewBox);
}
コード例 #3
0
ファイル: BaseDialog.cpp プロジェクト: HuugY/MFC_Project
void CBaseDialog::DrawClientArea( CDC*pDC,int nWidth,int nHeight )
{
	//创建缓冲
	CImage ImageBuffer;
	ImageBuffer.Create(nWidth,nHeight,32);

	//变量定义
	CDC * pBufferDC=CDC::FromHandle(ImageBuffer.GetDC());

	pBufferDC->FillSolidRect(1,0,nWidth-2,nHeight,RGB(234,238,244));

	if ( CHECK_IMAGE(m_pImageBack) )
	{
		m_pImageBack->DrawImage(pBufferDC,0,0,nWidth-1,nHeight-1);
	}
 
	if ( CHECK_IMAGE(m_pShadow) )
	{
		m_pShadow->DrawImage(pBufferDC,0,0,nWidth-1,nHeight-1);
	}

	DrawView(pBufferDC,nWidth-2,nHeight);

	pBufferDC->SetBkMode(TRANSPARENT);
	pBufferDC->SelectObject(RenderEngine->GetDeaultFont());
	pBufferDC->SetTextColor(RGB(255,255,255));

	//绘画界面
	pDC->BitBlt(0,0,nWidth,nHeight,pBufferDC,0,0,SRCCOPY);

	//清理资源
	ImageBuffer.ReleaseDC();
}
コード例 #4
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
void EditView::OnPaletteReplaced()
{
    // redraw the whole project
    Box area(ProjToView(Proj().GetAnim().GetFrame(Frame()).Bounds()));
    Box affected;
    DrawView(area,&affected);
    Redraw(affected);
}
コード例 #5
0
ファイル: COpenGLView.cpp プロジェクト: MGraefe/deferred
//---------------------------------------------------------------
// Purpose: 
//---------------------------------------------------------------
void COpenGLView::OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar )
{
	if( !m_RenderView )
		return;

	int pos = m_RenderView->HandleVScroll( nSBCode, (int)nPos );
	SetScrollPos(SB_VERT, pos);
	DrawView();
}
コード例 #6
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
void EditView::SetFrame( int frame )
{
    assert( frame>=0);
    assert( frame<Proj().GetAnim().NumFrames());

    m_Frame = frame;
    ConfineView();
    DrawView(m_ViewBox);
    Redraw(m_ViewBox);
}
コード例 #7
0
ファイル: AwardContainer.cpp プロジェクト: jinhuafeng/RS-MAN
void CAwardContainer::GfxTimerFiredL(TInt /*aId*/)
{
    if (iTicks < MAX_TICKS)
    {
        iTicks++;
    }
    Quantum();
    DrawView();
    DrawNow();
}
コード例 #8
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
void EditView::EraseCursor()
{
    std::vector<Box>::const_iterator it;
    std::vector<Box>::const_iterator itend = m_CursorDamage.end();
    for( it=m_CursorDamage.begin(); it!=itend; ++it )
    {
        Box clipped;
        DrawView(*it, &clipped );
        Redraw( clipped );
    }

    m_CursorDamage.clear();
}
コード例 #9
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
// called when project has been modified
void EditView::OnDamaged( int frame, Box const& projdmg )
{
    if (frame != m_Frame)
        return;

    Box viewdirtied;

    // just redraw the damaged part of the project...
    Box area(ProjToView(projdmg));
    DrawView(area, &viewdirtied );

    // tell the gui to display damaged part
    Redraw( viewdirtied );
}
コード例 #10
0
ファイル: View2.cpp プロジェクト: pigoblock/TFYP
void View2::OnDraw(CDC* pDC)
{
	CKEGIESDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

	// TODO: 
	wglMakeCurrent(m_hDC,m_hRC);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glClearColor(1,1,1, 1);
	DrawView();

	SwapBuffers(m_hDC);
}
コード例 #11
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
void EditView::SetZoom( int zoom )
{
    if(zoom<1)
        zoom=1;
    if(zoom>128)
        zoom=128;
    if(zoom == m_Zoom)
        return;
    m_Zoom = zoom;
    m_XZoom = Proj().Settings().PixW*zoom;
    m_YZoom = Proj().Settings().PixH*zoom;
    ConfineView();
    DrawView(m_ViewBox);
    Redraw(m_ViewBox);
}
コード例 #12
0
ファイル: View2.cpp プロジェクト: pigoblock/TFYP
void View2::OnDraw(CDC* pDC)
{
	CKEGIESDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc){
		return;
	}

	// TODO: ??
	wglMakeCurrent(m_hDC, m_hRC);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	arrayVec3f bColor = {Vec3f(0,0,0), Vec3f(0.7,0.7,0.7), Vec3f(1,1,1)};
	glClearColor(bColor[bColorIdx][0], bColor[bColorIdx][1], bColor[bColorIdx][1], 1);

	DrawView();

	SwapBuffers(m_hDC);
}
コード例 #13
0
ファイル: editview.cpp プロジェクト: bcampbell/evilpixie
EditView::EditView( Editor& editor, int w, int h ) :
    m_Editor(editor),
    m_PrevPos(-1,-1),
    m_Canvas( new Img(FMT_RGBX8,w,h ) ),
    m_ViewBox(0,0,w,h),
    m_Frame(0),
    m_Zoom(4),
    m_Offset(0,0),
    m_Panning(false),
    m_PanAnchor(0,0)
{
    m_XZoom = m_Zoom*editor.Proj().Settings().PixW;
    m_YZoom = m_Zoom*editor.Proj().Settings().PixH;
    CenterView();
    DrawView(m_ViewBox);
    Proj().AddListener( this );
    editor.AddView( this );
}
コード例 #14
0
ファイル: main.cpp プロジェクト: dreamsxin/ultimatepp
void TreeTest::Paint(Draw& w) 
{
//	Ctrl::ShowRepaint(50);

	// set the stage
	m_rcClient = GetSize();	
	
	//#################################
	DrawView(w);
	//#################################

//	if(m_optionGrid.GetData())
//	{
		DrawGrid(w);	
//	}

	// draw currently edited layer here instead of into the m_view
//	if(m_nMode==EDIT && m_pEditing)
//	{
//		PostCallback(callback(this,&OpenWind::DrawEdited));
//	}
}
コード例 #15
0
ファイル: PausedContainer.cpp プロジェクト: jinhuafeng/RS-MAN
void CPausedContainer::GfxTimerFiredL(TInt /*aId*/)
{
    Quantum();
    DrawView();
    DrawNow();
}