void EditView::SetOffset( Point const& projpos ) { m_Offset = projpos; ConfineView(); DrawView(m_ViewBox); Redraw(m_ViewBox); }
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); }
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(); }
void EditView::OnPaletteReplaced() { // redraw the whole project Box area(ProjToView(Proj().GetAnim().GetFrame(Frame()).Bounds())); Box affected; DrawView(area,&affected); Redraw(affected); }
//--------------------------------------------------------------- // 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(); }
void EditView::SetFrame( int frame ) { assert( frame>=0); assert( frame<Proj().GetAnim().NumFrames()); m_Frame = frame; ConfineView(); DrawView(m_ViewBox); Redraw(m_ViewBox); }
void CAwardContainer::GfxTimerFiredL(TInt /*aId*/) { if (iTicks < MAX_TICKS) { iTicks++; } Quantum(); DrawView(); DrawNow(); }
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(); }
// 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 ); }
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); }
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); }
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); }
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 ); }
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)); // } }
void CPausedContainer::GfxTimerFiredL(TInt /*aId*/) { Quantum(); DrawView(); DrawNow(); }