void CBigMap::DrawBigMap() { CFRect rtWnd = CFRect( 0, 0, (float)GetWndWidth(), (float)GetWndHeight() ); CColor uColor = CColor::White; CVector2f vStart( (float)GetWndHandle()->m_xScreen, (float)GetWndHandle()->m_yScreen ); CVector2f rtScreen[4] = { vStart , vStart + CVector2f((float)GetWndHandle()->m_Width,0.0f) , vStart + CVector2f(0.0f,(float)GetWndHandle()->m_Height) , vStart + CVector2f((float)GetWndHandle()->m_Width,(float)GetWndHandle()->m_Height)}; float Zoom = GetRootWnd()->GetZoomSize(); IMAGE& image = GetWndHandle()->m_Enable.GetImage(0); CFRect rtImage((float)image.posWnd.x, (float)image.posWnd.y, image.posWnd.x + abs(image.rtTexture.Width()), image.posWnd.y + abs(image.rtTexture.Height())); rtImage.top *= Zoom; rtImage.left *= Zoom; rtImage.bottom *= Zoom; rtImage.right *= Zoom; CFRect rtDraw = rtWnd.Intersection(rtImage).Offset(0.0f,0.0f); CFRect rtText( image.rtTexture.left, image.rtTexture.top, ( rtImage.right - rtImage.left )*image.rtTexture.Width() /rtImage.Width() + image.rtTexture.left, ( rtImage.bottom - rtImage.top )*image.rtTexture.Height()/rtImage.Height() + image.rtTexture.top); if(m_bOpen&&!m_bClose) DrawRect(m_MapTextureOpen, rtDraw, uColor, &rtText,false); else DrawRect( rtScreen, uColor,m_pAlphaTexture,m_MapTextureOpen,m_MapTextureClose/*,&rtText,m_BackTexUV*/, RS_GUI_BIGMAP, GetWndHandle()->m_fZ ); }
void CFDE_TextOut::DrawLogicText(const FX_WCHAR* pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) { CFX_RectF rtText(x, y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f); DrawLogicText(pwsStr, iLength, rtText); }
void CFDE_TextOut::CalcLogicSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_SizeF& size) { CFX_RectF rtText(0.0f, 0.0f, size.width, size.height); CalcLogicSize(pwsStr, iLength, rtText); size = rtText.Size(); }
void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, int32_t iLength, int32_t x, int32_t y) { CFX_RectF rtText(static_cast<FX_FLOAT>(x), static_cast<FX_FLOAT>(y), m_fFontSize * 1000.0f, m_fFontSize * 1000.0f); DrawText(pwsStr, iLength, rtText); }
void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect) { CFX_RectF rtText(rect.left, rect.top, rect.width, rect.height); CFX_Matrix rm; rm.SetReverse(m_Matrix); rm.TransformRect(rtText); DrawText(pwsStr, iLength, rtText, m_rtClip); }
void CSplashScreenEx::DrawWindow(CDC *pDC) { CDC memDC; CBitmap *pOldBitmap; CRect rtText(m_rcText); if(m_bitmap.GetSafeHandle()!=0){ // Blit Background memDC.CreateCompatibleDC(pDC); pOldBitmap=memDC.SelectObject(&m_bitmap); pDC->BitBlt(0,0,m_nBitmapWidth,m_nBitmapHeight,&memDC,0,0,SRCCOPY); memDC.SelectObject(pOldBitmap); }else{ CBrush brText; brText.CreateSolidBrush(m_crTextColor); CBrush brBg; brBg.CreateSolidBrush(m_crBgColor); pDC->FillRect(&rtText,&brBg); pDC->FrameRect(&rtText,&brText); rtText.DeflateRect(2,2,2,2); pDC->FrameRect(&rtText,&brText); rtText.DeflateRect(5,5,5,5); } // Draw Text CFont *pOldFont; pOldFont=pDC->SelectObject(&m_myFont); pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(m_crTextColor); if(m_rcText.Height()==0){ rtText.bottom=rtText.top+rtText.Width();// Просто чтобы непусто было pDC->DrawText(m_strText,-1,rtText,m_uTextFormat|DT_CALCRECT); m_nBitmapHeight=int(rtText.Height()+2.5*GetSystemMetrics(SM_CYMENU)+20);/*Границы*/ m_rcText.bottom=m_rcText.top+m_nBitmapHeight; }else{ if(m_strTitle!=""){ pDC->DrawText(m_strTitle,-1,rtText,m_uTextFormat); rtText.top+=GetSystemMetrics(SM_CYMENU); } if(m_strFooter!=""){ CRect rtFooter(rtText); rtFooter.top=rtFooter.bottom-GetSystemMetrics(SM_CYMENU); pDC->DrawText(m_strFooter,-1,rtFooter,m_uTextFormat); rtText.bottom-=GetSystemMetrics(SM_CYMENU); } pDC->DrawText(m_strText,-1,rtText,m_uTextFormat); } pDC->SelectObject(pOldFont); }