HRESULT CAnimationModel::DrawFrame( LPD3DXFRAME pFrame ) { HRESULT hr = S_OK; LPD3DXMESHCONTAINER pMeshContainer = pFrame->pMeshContainer; while( NULL != pMeshContainer ) { hr = DrawMeshContainer( pFrame, pMeshContainer ); CHECK_FAILED( hr ); pMeshContainer = pMeshContainer->pNextMeshContainer; } if( pFrame->pFrameSibling ) { hr = DrawFrame( pFrame->pFrameSibling ); CHECK_FAILED( hr ); } if( pFrame->pFrameFirstChild ) { hr = DrawFrame( pFrame->pFrameFirstChild ); CHECK_FAILED( hr ); } return hr; }
/**************************************************************** * VOID WINAPI tdDraw3DCrease( HDC hDC, LPRECT lprc, UINT uiFlags ) * * Description: * * * * Comments: * ****************************************************************/ VOID WINAPI tdDraw3DCrease( HDC hDC, LPRECT lpRect, UINT uiFlags ) { RECT rc ; COLORREF rgbOld ; rc = *lpRect ; if (uiFlags & DRAW3D_OUT) OffsetRect( &rc, 1, 1 ) ; rgbOld = SetBkColor( hDC, tdGetShadowColor( GetBkColor( hDC ) ) ) ; DrawFrame( hDC, &rc ) ; if (uiFlags & DRAW3D_OUT) OffsetRect( &rc, -1, -1 ) ; else OffsetRect( &rc, 1, 1 ) ; SetBkColor( hDC, tdGetHighlightColor( rgbOld ) ) ; DrawFrame( hDC, &rc ) ; SetBkColor( hDC, rgbOld ) ; } /* tdDraw3DCrease() */
static void ActivateFrame (int Num, unsigned char Clear) /* Activate a new frame, deactivate the old one */ { unsigned char y; register FrameDesc* F; if (ActiveFrame != Num) { /* Deactivate the old one */ if (ActiveFrame >= 0) { DrawFrame (Frames [ActiveFrame], 0); } /* Activate the new one */ if ((ActiveFrame = Num) >= 0) { F = Frames [ActiveFrame]; /* Clear the frame if requested */ if (Clear) { for (y = F->fd_y1+1; y < F->fd_y2; ++y) { cclearxy (F->fd_x1+1, y, F->fd_width); } } DrawFrame (F, 1); } /* Redraw the current prompt line */ DisplayPrompt (ActivePrompt); } }
void SkinnedMesh::DrawFrame() { LPD3DXMESHCONTAINER pMeshContainer; // 조심해! // 적당한 위치 찾을 것 DDRenderer::GetInstance()->GetDevice()->SetTransform( D3DTS_WORLD, &m_Matrix ); pMeshContainer = m_pFrameRoot->pMeshContainer; while ( pMeshContainer != NULL ) { DrawMeshContainer( pMeshContainer, m_pFrameRoot ); pMeshContainer = pMeshContainer->pNextMeshContainer; } if ( m_pFrameRoot->pFrameSibling != NULL ) { DrawFrame( m_pFrameRoot->pFrameSibling ); } if ( m_pFrameRoot->pFrameFirstChild != NULL ) { DrawFrame( m_pFrameRoot->pFrameFirstChild ); } }
void EditView::Paint( const Rect& cUpdateRect ) { FillRect( cUpdateRect, get_default_color( COL_NORMAL ) ); Rect cLargeRect = m_cLargeRect; Rect cSmallRect = m_cSmallRect; cLargeRect.left -= 2.0f; cLargeRect.top -= 2.0f; cLargeRect.right += 2.0f; cLargeRect.bottom += 2.0f; cSmallRect.left -= 2.0f; cSmallRect.top -= 2.0f; cSmallRect.right += 2.0f; cSmallRect.bottom += 2.0f; if ( m_bLargeSelected ) { DrawFrame( cLargeRect, FRAME_RECESSED | FRAME_TRANSPARENT ); DrawFrame( cSmallRect, FRAME_RAISED | FRAME_TRANSPARENT ); } else { DrawFrame( cLargeRect, FRAME_RAISED | FRAME_TRANSPARENT ); DrawFrame( cSmallRect, FRAME_RECESSED | FRAME_TRANSPARENT ); } SetDrawingMode( DM_BLEND ); if ( m_pcLargeBitmap != NULL ) { DrawBitmap( m_pcLargeBitmap, m_pcLargeBitmap->GetBounds(), m_cLargeRect ); } if ( m_pcSmallBitmap != NULL ) { DrawBitmap( m_pcSmallBitmap, m_pcSmallBitmap->GetBounds(), m_cSmallRect ); } SetDrawingMode( DM_COPY ); }
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win ) { if (g_isIdle) wxapp_install_idle_handler(); if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return TRUE; if (g_blockEventsOnScroll) return TRUE; if (!win->m_isDragging) return TRUE; if (gdk_event->is_hint) { int x = 0; int y = 0; GdkModifierType state; gdk_window_get_pointer(gdk_event->window, &x, &y, &state); gdk_event->x = x; gdk_event->y = y; gdk_event->state = state; } DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height ); win->m_oldX = (int)gdk_event->x - win->m_diffX; win->m_oldY = (int)gdk_event->y - win->m_diffY; DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height ); return TRUE; }
void plotRhoEtaSlices(TString str = "RandomConesPF.root", TString tag = "HYDJETMB") { gStyle->SetOptStat(0000); gStyle->SetOptTitle(0); TFile *f = new TFile(str.Data()); TH3F *fh3RhoCentEtaBin = dynamic_cast<TH3F*>(f->Get("fh3RhoCentEtaBin")); TH3F *fh3RhoMCentEtaBin = dynamic_cast<TH3F*>(f->Get("fh3RhoMCentEtaBin")); const int netabins = 7; double etaMin[netabins] = {-5.,-3.,-2.1,-1.3,1.3,2.1,3.}; double etaMax[netabins] = {-3.,-2.1,-1.3,1.3,2.1,3.,5.}; TH2D *h2RhoCent[netabins]; TH2D *h2RhoMCent[netabins]; TH2D *h2RhoJetCent[netabins]; for(int i = 1; i<=netabins; ++i) { fh3RhoCentEtaBin->GetZaxis()->SetRange(i,i); h2RhoCent[i-1] = dynamic_cast<TH2D*>(fh3RhoCentEtaBin->Project3D("yx")); h2RhoCent[i-1]->SetName(Form("hRhoCentEta%d",i)); h2RhoCent[i-1]->SetTitle(Form("hRhoCentEta%d",i)); fh3RhoMCentEtaBin->GetZaxis()->SetRange(i,i); h2RhoMCent[i-1] = dynamic_cast<TH2D*>(fh3RhoMCentEtaBin->Project3D("yx")); h2RhoMCent[i-1]->SetName(Form("hRhoMCentEta%d",i)); h2RhoMCent[i-1]->SetTitle(Form("hRhoMCentEta%d",i)); } TCanvas *c1 = new TCanvas("c1","c1: rho",900,840); c1->Divide(3,3); for(int i = 1; i<=netabins; ++i) { c1->cd(i); TH1F *fr1 = DrawFrame(0.,100.,0.,500.,"centrality (%)","#rho GeV/c"); gPad->SetLogz(); h2RhoCent[i-1]->Draw("colz same"); DrawLatex(0.5,0.77,Form("%.1f<#eta<%.1f",etaMin[i-1],etaMax[i-1])); } c1->SaveAs("RhoCentEtaBins.png"); TCanvas *c2 = new TCanvas("c2","c2: rho_m",900,840); c2->Divide(3,3); for(int i = 1; i<=netabins; ++i) { c2->cd(i); TH1F *fr2 = DrawFrame(0.,100.,0.,2.,"centrality (%)","#rho_{m} GeV/c"); gPad->SetLogz(); h2RhoMCent[i-1]->Draw("colz same"); DrawLatex(0.5,0.77,Form("%.1f<#eta<%.1f",etaMin[i-1],etaMax[i-1])); } c2->SaveAs("RhoMCentEtaBins.png"); }
void RightTabs::FramePaint(Draw& w, const Rect& rr) { Rect r = rr; r.right -= cx; DrawFrame(w, r, FieldFrameColor()); DrawFrame(w, r.Deflated(1), SColorPaper); if(cursor >= 0) { Tab& t = tab[cursor]; w.DrawRect(r.right - 1, t.y + 1, 1, t.GetHeight() + 1, SColorFace); } }
void SkinnedMesh::DrawFrame( LPD3DXFRAME pFrame ) { DDCamera* camera = GPlayerManager->GetCamera(); if ( !camera ) return; D3DXMATRIXA16 matProj = camera->GetMatProj(); // Set the projection matrix for the vertex shader based skinning method if ( FAILED( m_pEffect->SetMatrix( "mViewProj", &matProj ) ) ) { assert( false ); return; } // Set Light for vertex shader // 조심해!! // 전역 라이트 속성 가져올 것 D3DXVECTOR4 vLightDir( 0.0f, 1.0f, -1.0f, 0.0f ); D3DXVec4Normalize( &vLightDir, &vLightDir ); if ( FAILED( DDRenderer::GetInstance()->GetDevice()->SetVertexShaderConstantF( 1, (float*)&vLightDir, 1 ) ) ) { assert( false ); return; } if ( FAILED( m_pEffect->SetVector( "lhtDir", &vLightDir ) ) ) { assert( false ); return; } LPD3DXMESHCONTAINER pMeshContainer; pMeshContainer = pFrame->pMeshContainer; while ( pMeshContainer != NULL ) { DrawMeshContainer( pMeshContainer, pFrame ); pMeshContainer = pMeshContainer->pNextMeshContainer; } if ( pFrame->pFrameSibling != NULL ) { DrawFrame( pFrame->pFrameSibling ); } if ( pFrame->pFrameFirstChild != NULL ) { DrawFrame( pFrame->pFrameFirstChild ); } }
void cxAndroid::cxAndroidMain() { vm = activity->vm; vm->AttachCurrentThread(&env, nullptr); CX_ASSERT(env != nullptr, "attach current thread java env error"); //startup engine cxEngine::Startup(false); while(!destroyReq){ if(ProcessInput()){ break; } if(animating) { DrawFrame(); } } //destroy engine cxEngine::Destroy(); //clear core cache cxCore::Instance()->Clear(); DestroyDisplay(); if(env != nullptr){ vm->DetachCurrentThread(); env = NULL; } }
void CCoolTabCtrl::OnPaint() { CPaintDC dc(this); CPen *pOldPen = dc.GetCurrentPen(); CFont *pOldFont = dc.SelectObject(&m_font); int nOldBkMode = dc.SetBkMode(TRANSPARENT); CPageItem *pItem; POSITION pos; int nItemIndex = 0; DrawFrame(&dc); for(pos=m_PageList.GetHeadPosition();pos!=NULL;nItemIndex++) { pItem=(CPageItem*)m_PageList.GetNext(pos); if(pItem) { pItem->Draw(&dc,m_nStyle,(m_nActivePage==nItemIndex)?TRUE:FALSE); } } dc.SetBkMode(nOldBkMode); dc.SelectObject(pOldFont); dc.SelectObject(pOldPen); }
//********************************************************************************* void CBCGPShadowRenderer::Draw (CDC* pDC, CRect rect, UINT index/* = 0*/, BYTE alphaSrc/* = 255*/) { if (128 <= alphaSrc) { CRect rectInter (rect); if (CBCGPToolBarImages::IsRTL ()) { rectInter.left += m_Params.m_rectSides.left; rectInter.right = rectInter.left + m_Params.m_rectSides.left; } else { rectInter.right -= m_Params.m_rectSides.right; rectInter.left = rectInter.right - m_Params.m_rectSides.right; } rectInter.bottom -= m_Params.m_rectSides.bottom; rectInter.top = rectInter.bottom - m_Params.m_rectSides.bottom; FillInterior (pDC, rectInter, index, alphaSrc); } DrawFrame (pDC, rect, index, alphaSrc); }
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win ) { if (g_isIdle) wxapp_install_idle_handler(); if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return TRUE; if (g_blockEventsOnScroll) return TRUE; if (!win->m_isDragging) return TRUE; win->m_isDragging = false; int x = (int)gdk_event->x; int y = (int)gdk_event->y; DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height ); gdk_pointer_ungrab ( (guint32)GDK_CURRENT_TIME ); int org_x = 0; int org_y = 0; gdk_window_get_origin( widget->window, &org_x, &org_y ); x += org_x - win->m_diffX; y += org_y - win->m_diffY; win->m_x = x; win->m_y = y; gtk_widget_set_uposition( win->m_widget, x, y ); return TRUE; }
bool ListPage::Draw() { TRACE("Drawing page\n"); if (!m_bWidthsCalculated) CalcRealColumnWidths(); TRACE("Got column widths\n"); DrawFrame(PageRect()); TRACE("Drawn Frames\n"); if (m_dwFlags & LF_SHOW_HEADER) DrawHeader(); TRACE("Drawn Header\n"); DrawVisibleItems(); TRACE("Drawn Items\n"); DrawFooterAndScrollBar(); TRACE("Drawn footer/scroll bar\n"); TAP_Osd_Copy(m_osdRegionIndex, GetTAPScreenRegion(), 0, 0, m_rcList.w, m_rcList.h, m_rcList.x, m_rcList.y, false); TRACE("Copied memory image to screen\n"); return true; }
void CSkinDialog::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { m_bActive = (nState ? TRUE : FALSE); if( GetWindowLong(GetSafeHwnd(), GWL_STYLE) & WS_CAPTION ) { if( m_bActive ) { m_hIcon = Global.GetIcon(IDX_ICON_SKIN,ICON24); m_cfText = Global.GetRGB(IDX_RGB_FONT_CAPTION); } else { m_hIcon = Global.GetIcon(IDX_ICON_SKIN_INACTIVE,ICON24); m_cfText = Global.GetRGB(IDX_RGB_FONT_CAPTION_INACTIVE); } DrawFrame(); } else { CDialog::OnActivate(nState, pWndOther, bMinimized); } // TODO: Add your message handler code here }
// Called periodically void DrawLoop() { static uint scroll = 1; while (1) { uint t1, t2; uint next_tick = systick + DRAW_INTERVAL; t1 = systick; if (!lock_display) { display_frame_ready = false; DrawFrame(); display_frame_ready = true; if (wipe_frame == 0) { //_LAT(LED1) = 1; UpdateDisplay(); //_LAT(LED1) = 0; } else { // Blocking call UpdateDisplayWipeIn(wipe_frame); wipe_frame = 0; } } t2 = systick; draw_ticks = (t2 >= t1) ? (t2 - t1) : 0; Delay(DRAW_INTERVAL); //WaitUntil(next_tick); //Delay(0); } }
void Ide::MakeIcon() { #ifdef PLATFORM_WIN32 String mp = main; Image li = IdeImg::PackageLarge(); if(!IsNull(mp)) { Size isz = li.GetSize(); ImageDraw idraw(isz); Draw& mdraw = idraw.Alpha(); idraw.DrawImage(0, 0, li); mdraw.DrawImage(0, 0, li, White); Font font = StdFont(9); Size sz = GetTextSize(mp, font); sz.cx = min(sz.cx + 4, isz.cx); sz.cy += 2; int x = (isz.cx - sz.cx) / 2; int y = isz.cy - sz.cy; idraw.DrawRect(x, y, sz.cx, sz.cy, White); mdraw.DrawRect(x, y, sz.cx, sz.cy, White); idraw.DrawText(x + 2, y + 1, mp, font, Black); DrawFrame(idraw, x, y, sz.cx, sz.cy, LtBlue); li = idraw; } LargeIcon(li); #endif }
inline void CQueueView::DrawOutputFrame(CPoint pt, const PFRAME Frame) { m_DC.SetTextAlign(TA_RIGHT); m_DC.TextOut(pt.x - CaptionMargin.cx, pt.y + CaptionMargin.cy, "Out:"); if (Frame != NULL) DrawFrame(pt, Frame); }
void DrawLoop(OpenGLDrawData &oglData) { util::dcout << "Starting main loop ..." << std::endl; LARGE_INTEGER frequency; LARGE_INTEGER lastTime; LARGE_INTEGER currentTime; QueryPerformanceFrequency(&frequency); QueryPerformanceCounter(&lastTime); double totalElapsedTime = 0.0; bool running = true; while(running) { DrawFrame(oglData); SwapBuffers(oglData.oglDC); QueryPerformanceCounter(¤tTime); double deltaTime = (double)(currentTime.QuadPart - lastTime.QuadPart) / (double)frequency.QuadPart; totalElapsedTime += deltaTime; lastTime = currentTime; if(totalElapsedTime >= 10.0) { running = false; util::dcout << "Exiting main loop ..." << std::endl; break; } Sleep(4); } }
void CXTPSkinObjectFrame::OnNcPaint() { #if 0 static _int64 nPerfomanceEnd; _int64 nPerfomanceStart; static _int64 nPerfomanceSum = 0; QueryPerformanceCounter((LARGE_INTEGER*)&nPerfomanceStart); if (nPerfomanceStart - nPerfomanceEnd > 100000) { TRACE(_T("Reset Timer \n")); nPerfomanceSum = 0; } #endif if (IsFlatScrollBarInitialized()) { Default(); } else { UpdateButtons(); CWindowDC dc(this); DrawFrame(&dc); } #if 0 QueryPerformanceCounter((LARGE_INTEGER*)&nPerfomanceEnd); nPerfomanceSum += nPerfomanceEnd - nPerfomanceStart; TRACE(_T("TotalCounter = %i \n"), int(nPerfomanceSum)); #endif }
LRESULT CXTPSkinObjectFrame::OnPrint(WPARAM wParam, LPARAM lParam) { LRESULT lResult = TRUE; if (lParam != PRF_NONCLIENT) { m_bLockFrameDraw++; lResult = DefWindowProc(WM_PRINT, wParam, lParam); m_bLockFrameDraw--; } if (lParam & PRF_NONCLIENT) { if (m_spi[SB_VERT].fVisible) m_spi[SB_VERT].fVisible = GetStyle() & WS_VSCROLL; if (m_spi[SB_HORZ].fVisible) m_spi[SB_HORZ].fVisible = GetStyle() & WS_HSCROLL; CDC* pDC = CDC::FromHandle((HDC)wParam); if ((GetExStyle() & WS_EX_LAYOUTRTL) && !XTPDrawHelpers()->IsContextRTL(pDC)) XTPDrawHelpers()->SetContextRTL(pDC, 1); DrawFrame(pDC); } return lResult; }
void HeaderCtrl::LeftDrag(Point p, dword keyflags) { if(li < 0 || !moving) return; int n = 0; for(int i = 0; i < col.GetCount(); i++) if(col[i].visible) n++; if(n < 2) return; push = false; ti = li; pushi = -1; Refresh(); Rect r = GetTabRect(li).OffsetedHorz(-sb); Size sz = r.GetSize(); ImageDraw iw(sz.cx, sz.cy); bool first = true; col[li].Paint(first, iw, 0, 0, sz.cx, sz.cy, false, false, false); DrawFrame(iw, sz, SColorText()); dragtab = iw; dragx = p.x; dragd = r.left - p.x; ImageBuffer ib(dragtab); Unmultiply(ib); RGBA *s = ~ib; RGBA *e = s + ib.GetLength(); while(s < e) { s->a >>= 1; s++; } Premultiply(ib); dragtab = ib; isdrag = true; }
void DashboardInstrument_Dial::Draw(wxGCDC* bdc) { wxColour c1; GetGlobalColor(_T("DASHB"), &c1); wxBrush b1(c1); bdc->SetBackground(b1); bdc->Clear(); wxSize size = GetClientSize(); m_cx = size.x / 2; int availableHeight = size.y - m_TitleHeight - 6; int width, height; bdc->GetTextExtent( _T("000"), &width, &height, 0, 0, g_pFontLabel ); m_cy = m_TitleHeight + 2; m_cy += availableHeight / 2; m_radius = availableHeight / 2; DrawLabels(bdc); DrawFrame(bdc); DrawMarkers(bdc); DrawBackground(bdc); DrawData(bdc, m_MainValue, m_MainValueUnit, m_MainValueFormat, m_MainValueOption); DrawData(bdc, m_ExtraValue, m_ExtraValueUnit, m_ExtraValueFormat, m_ExtraValueOption); DrawForeground(bdc); }
void displayCallback() { if (showMap == 1) { DrawParabolicMapWithCube(); } else if (showMap == 2) { DrawParabolicMapWithSphere(); } else { glEnable(GL_SCISSOR_TEST); for (int view = 0; view < 4; view++) { SelectViewport(view, true); if (view == ROTATE) DrawSurface(); else DrawFrame(); DrawGrid(); if (view != ROTATE) DrawControlPoints(); } glDisable(GL_SCISSOR_TEST); if (saveScreens) ScreenShot(); } glutSwapBuffers(); }
void CWindowOPTION_TASKBAR::Draw(PCImg32 pDst) { int nLevel; HDC hDC; HFONT hFontOld; COLORREF clText; if (m_dwTimeDrawStart) { goto Exit; } DrawFrame (); clText = RGB (1, 1, 1); hDC = m_pDib->Lock (); hFontOld = (HFONT)SelectObject (hDC, m_hFont); SetBkMode (hDC, TRANSPARENT); TextOut2 (hDC, 32, 16 + 16 * 0, "ON", clText); TextOut2 (hDC, 32, 16 + 16 * 1, "OFF", clText); SelectObject (hDC, hFontOld); m_pDib->Unlock (); DrawCursor (8, 16 + 16 * m_nPos); m_dwTimeDrawStart = timeGetTime (); Exit: nLevel = 100; if (m_bActive == FALSE) { nLevel = 60; } pDst->BltLevel (m_ptViewPos.x + 32, m_ptViewPos.y + 32, m_sizeWindow.cx, m_sizeWindow.cy, m_pDib, 0, 0, nLevel, TRUE); }
void TacticsInstrument_AppTrueWindAngle::Draw(wxGCDC* bdc) { wxColour c1; GetGlobalColor(_T("DASHB"), &c1); wxBrush b1(c1); bdc->SetBackground(b1); bdc->Clear(); wxSize size = GetClientSize(); m_cx = size.x / 2; int availableHeight = size.y - m_TitleHeight - 6; int width, height; bdc->GetTextExtent(_T("000"), &width, &height, 0, 0, g_pFontLabel); m_cy = m_TitleHeight + 2; m_cy += availableHeight / 2; m_radius = availableHeight / 2.0 * 0.95; DrawLabels(bdc); DrawFrame(bdc); DrawMarkers(bdc); DrawBackground(bdc); DrawData(bdc, m_MainValueApp, m_MainValueAppUnit, m_MainValueFormat, m_MainValueOption1); DrawData(bdc, m_MainValueTrue, m_MainValueTrueUnit, m_MainValueFormat, m_MainValueOption2); DrawData(bdc, m_ExtraValueApp, m_ExtraValueAppUnit, m_ExtraValueFormat, m_ExtraValueOption1); DrawData(bdc, m_ExtraValueTrue, m_ExtraValueTrueUnit, m_ExtraValueFormat, m_ExtraValueOption2); DrawData(bdc, m_TWD, m_MainValueTrueUnit, _T("TWD:%.0f"), DIAL_POSITION_INSIDE); DrawForeground(bdc); }
void UPaperFlipbookThumbnailRenderer::Draw(UObject* Object, int32 X, int32 Y, uint32 Width, uint32 Height, FRenderTarget* RenderTarget, FCanvas* Canvas) { if (UPaperFlipbook* Flipbook = Cast<UPaperFlipbook>(Object)) { const double DeltaTime = FApp::GetCurrentTime() - GStartTime; const float TotalDuration = Flipbook->GetTotalDuration(); const float PlayTime = (TotalDuration > 0.0f) ? FMath::Fmod(DeltaTime, TotalDuration) : 0.0f; if (UPaperSprite* Sprite = Flipbook->GetSpriteAtTime(PlayTime)) { DrawFrame(Sprite, X, Y, Width, Height, RenderTarget, Canvas); return; } else { // Fallback for empty frames or newly created flipbooks DrawGrid(X, Y, Width, Height, Canvas); } if (TotalDuration == 0.0f) { // Warning text for no frames const FText ErrorText = NSLOCTEXT("FlipbookEditorApp", "ThumbnailWarningNoFrames", "No frames"); FCanvasTextItem TextItem(FVector2D(5.0f, 5.0f), ErrorText, GEngine->GetLargeFont(), FLinearColor::Red); TextItem.EnableShadow(FLinearColor::Black); TextItem.Scale = FVector2D(Width / 128.0f, Height / 128.0f); TextItem.Draw(Canvas); } } }
void MainWnd::_drawGradFrame(CDC *pdc, const CRect &outerrect, int width, unsigned int outercolor, unsigned int innercolor, bool usepen) { unsigned int outr, outg, outb, inr, ing, inb; outr = (outercolor & 0xff0000) >> 16; outg = (outercolor & 0xff00) >> 8; outb = (outercolor & 0xff) ; inr = (innercolor & 0xff0000) >> 16; ing = (innercolor & 0xff00) >> 8; inb = (innercolor & 0xff) ; CRect rect = outerrect; int inc; if(width > 0) inc = 1; else inc = -1; #define Get(a, b) ((int)a+((int)b - (int)a)*i/(width - inc)) for(int i = 0; i != width; i += inc){ if(usepen) DrawPenFrame(pdc, rect, RGB(Get(outr, inr), Get(outg, ing), Get(outb, inb))); else DrawFrame(pdc, rect, RGB(Get(outr, inr), Get(outg, ing), Get(outb, inb))); rect.left += inc; rect.top += inc; rect.right -= inc; rect.bottom -= inc; } #undef Get }
void ColorButton::Paint(const Rect& cUpdateRect) { uint32 nFrameFlags = FRAME_RECESSED; DrawFrame(GetBounds(), nFrameFlags ); View::FillRect(Rect(5,5,GetBounds().Width()-5,GetBounds().Height()-5),sColorBg); }
void ScribbleWindow::Draw() { BeginDraw(); DrawFrame(); DrawChildren(); EndDraw(); }