void BlitScreen(void) { if(!raine_cfg.req_pause_game){ DrawNormal(); return; } DrawPaused(); }
void WINAPI duAnimation::DrawObject(HDC hDC) { duImage *pImage = (duImage *)GetResObj(m_szAnimation, DU_RES_IMAGE); if (pImage == NULL) return; int left = m_nCurFrame * (pImage->GetWidth() / m_nFrameCount); DrawNormal(hDC, 0, 0, pImage->GetWidth() / m_nFrameCount, pImage->GetHeight(), pImage, left, 0, GetAlpha()); }
void XMapLayerImage::Draw( void ) { switch( m_DrawType ) { case xNORMAL: DrawNormal(); break; case xSTRETCH: DrawStretch(); break; case xTILE: DrawTile(); break; default: XBREAK(1); } }
void duTreeListItem::DrawObject(HDC hDC) { duRect rcTreeListItem; GetRect(&rcTreeListItem); rcTreeListItem.OffsetRect(-rcTreeListItem.left, -rcTreeListItem.top); duRect rcIndent; rcIndent.left = m_nIndentStart + (m_nLevel - 1) * m_nExpandSpace; rcIndent.right = rcIndent.left + m_nIndentWidth; rcIndent.top = (rcTreeListItem.Height() - m_nIndentHeight) / 2; rcIndent.bottom = rcIndent.top + m_nIndentHeight; if (m_pTreeListItem && m_pTreeListItem->pFirstChild) { duStyleGroup *pStyleGroup = (duStyleGroup *)GetResObj(m_szIndentStyle, DU_RES_STYLEGROUP); if (pStyleGroup) pStyleGroup->Draw(hDC, &rcIndent, m_fExpand ? DU_STATE_NORMAL : DU_STATE_CHECKED, NULL, GetAlpha()); } if (m_fShowCheckBox) { duImage *pCheckBoxImage = (duImage *)GetResObj(m_szCheckBoxImage, DU_RES_IMAGE); if (pCheckBoxImage) { duRect rcCheckBox; rcCheckBox.left = rcIndent.right + m_nIndentSpace; rcCheckBox.right = rcCheckBox.left + m_nCheckBoxWidth; rcCheckBox.top = (rcTreeListItem.Height() - m_nCheckBoxHeight) / 2; rcCheckBox.bottom = rcCheckBox.top + m_nCheckBoxHeight; int nCheckBoxImageLeft = 0; if (m_uCheckBoxState == HEADER_CHECKBOX_CHECKED) nCheckBoxImageLeft = m_nCheckBoxWidth; else if (m_uCheckBoxState == HEADER_CHECKBOX_CHECKEDPART) nCheckBoxImageLeft = m_nCheckBoxWidth + m_nCheckBoxWidth; DrawNormal(hDC, rcCheckBox.left, rcCheckBox.top, rcCheckBox.Width(), rcCheckBox.Height(), pCheckBoxImage, nCheckBoxImageLeft, 0, GetAlpha()); } } }
void Game::Draw(Graphics* pGraph) { Map::GetInstance()->Draw(pGraph); switch ( m_gsState ) { case gsStart: DrawStart(pGraph); break; case gsNormal: DrawNormal(pGraph); break; case gsEnd: DrawEnd(pGraph); break; default: ASSERT(FALSE); break; } }
void duTreeCtrl::DrawObject(HDC hDC) { duRect rcTreeCtrl; Plugin_GetRect(this, &rcTreeCtrl); rcTreeCtrl.OffsetRect(-rcTreeCtrl.left, -rcTreeCtrl.top); BITMAPINFO bmInfo; BYTE *pBits; HDC hMemDC = ::CreateCompatibleDC(hDC); InitBitmapInfo(&bmInfo, rcTreeCtrl.Width(), rcTreeCtrl.Height()); HBITMAP hBmp = ::CreateDIBSection(hDC, &bmInfo, DIB_RGB_COLORS,(void**)&pBits, 0, 0); HBITMAP hOldBitmap = (HBITMAP)::SelectObject(hMemDC, hBmp); BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA}; ::AlphaBlend(hMemDC, 0, 0, rcTreeCtrl.Width(), rcTreeCtrl.Height(), hDC, 0, 0, rcTreeCtrl.Width(), rcTreeCtrl.Height(), bf); duStyleGroup *pStyleGroup = (duStyleGroup *)GetResObj(GetStyle(), DU_RES_STYLEGROUP); if (pStyleGroup) pStyleGroup->Draw(hMemDC, &rcTreeCtrl, GetState(), NULL, GetAlpha()); int nOffsetY = 0; TreeCtrlItem *pFirstVisible = GetFirstVisibleItem(nOffsetY); if (pFirstVisible == NULL || pFirstVisible == m_pRoot) return; duRect rcClient = _GetClientRect(); POINT ptView = GetViewPoint(); duFont *pFont = (duFont *)GetResObj(m_szFont, DU_RES_FONT); duSize sizeView; GetViewSize(&sizeView); int nDrawHeight = -nOffsetY; TreeCtrlItem *pItem = pFirstVisible; while (pItem) { duRect rcItem; rcItem.left = -ptView.x; rcItem.right = rcClient.right; rcItem.top = nDrawHeight; rcItem.bottom = rcItem.top + m_nItemHeight; UINT uItemState = DU_STATE_NORMAL; if (pItem == m_pHot) uItemState = DU_STATE_OVER; if (pItem == m_pSelect) uItemState = DU_STATE_PRESS; DrawByStyle(this, m_szItemStyle, hMemDC, &rcItem, uItemState, NULL, GetAlpha()); // draw indent[-+] int nLeft = (pItem->nLevel - 1) * m_nIndentWidth; duRect rcIndent = CalcVCenterRect(rcItem, nLeft, m_nIndentWidth, m_nIndentHeight); if (ItemHasChildren(pItem)) { UINT nIndentState = pItem->fExpand ? DU_STATE_NORMAL : DU_STATE_CHECKED; DrawByStyle(this, m_szIndentStyle, hMemDC, &rcIndent, nIndentState, NULL, GetAlpha()); } // draw icon nLeft += (m_nIndentWidth + m_nIndentIconSpace); duRect rcIcon = CalcVCenterRect(rcItem, nLeft, m_nIconWidth, m_nIconHeight); duImage *pIcon = (duImage *)GetResObj(pItem->strImage.c_str(), DU_RES_IMAGE); if (pIcon) DrawNormal(hMemDC, rcIcon.left, rcIcon.top, rcIcon.Width(), rcIcon.Height(), pIcon, 0, 0, GetAlpha()); // draw text duRect rcText; nLeft += (m_nIconWidth + m_nIconTextSpace); rcText = rcItem; rcText.left = rcItem.left + nLeft; if (pItem->strText.length() > 0) DrawText32Bpp(hMemDC, pFont, m_clrText, pItem->strText.c_str(), pItem->strText.length(), &rcText, DT_LEFT|DT_VCENTER|DT_SINGLELINE, GetAlpha()); if (nDrawHeight - nOffsetY > rcTreeCtrl.Height()) break; nDrawHeight += m_nItemHeight; pItem = GetNextVisibleItem(pItem); } ::AlphaBlend(hDC, 0, 0, rcTreeCtrl.Width(), rcTreeCtrl.Height(), hMemDC, 0, 0, rcTreeCtrl.Width(), rcTreeCtrl.Height(), bf); ::SelectObject(hMemDC, hOldBitmap); ::DeleteObject(hBmp); ::DeleteDC(hMemDC); }
/*! Draw current selected card // \param ATL_DRAWINFO& di : */ HRESULT CAxJpgCard::OnDraw(ATL_DRAWINFO& di) { RECT& rc = *(RECT*)di.prcBounds; HDC hdcComp = CreateCompatibleDC(di.hdcDraw); short iType; m_hCurrentImage->get_Type(&iType); ATLASSERT(iType == PICTYPE_BITMAP); //CreateDib(hdcComp); //SelectObject(hdcComp, (HBITMAP)m_hCurrentImage); SelectObject(hdcComp, m_hCurrentBitmap); // draw a contour rectangle if (m_eCardStatus != CSW_ST_MAZZO) Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom); rc.left += e_OverLine; rc.right -= e_OverLine; rc.top += e_OverLine; rc.bottom -= e_OverLine; m_rc = rc; switch (m_eCardStatus) { case CSW_ST_DRAWFIRST: // first draw GetDIBColorTable(hdcComp, 0, 256, m_pColors ); //DrawEmpty(rc, di.hdcDraw, hdcComp); //m_eCardStatus = CSW_ST_EMPTY; DrawNormal(rc, di.hdcDraw, hdcComp); m_eCardStatus = CSW_ST_DRAWNORMAL; //DrawAsMazzo(rc, di.hdcDraw, hdcComp); //m_eCardStatus = CSW_ST_MAZZO; //DrawRotated(rc, di.hdcDraw, hdcComp); //m_eCardStatus = CSW_ST_ROTATE90; //::OutputDebugString("Draw First\n"); break; case CSW_ST_MAZZO: // deck draw (mazzo) DrawAsMazzo(rc, di.hdcDraw, hdcComp); //::OutputDebugString("Draw Mazzo\n"); case CSW_ST_DRAWNORMAL: // usual draw DrawNormal(rc, di.hdcDraw, hdcComp); //::OutputDebugString("Draw Normal\n"); break; case CSW_ST_ANIMATETOBLACK: // animate bitmap color to black AnimateToBlack(rc, di.hdcDraw, hdcComp); m_eCardStatus = CSW_ST_EMPTY; //::OutputDebugString("Animate to black\n"); break; case CSW_ST_INVISIBLE: DrawInvisibile(rc, di.hdcDraw, hdcComp); m_eOldStatus = CSW_ST_INVISIBLE; //::OutputDebugString("Control invisible\n"); break; case CSW_ST_ROTATE90: DrawRotated(rc, di.hdcDraw, hdcComp); //::OutputDebugString("Draw rotate 90\n"); break; case CSW_ST_EMPTY: DrawEmpty(rc, di.hdcDraw, hdcComp); //::OutputDebugString("Draw Empty\n"); break; case CSW_ST_RESTORE: DrawOriginalColors(rc, di.hdcDraw, hdcComp); m_eCardStatus = CSW_ST_DRAWNORMAL; //::OutputDebugString("Draw restore\n"); break; case CSW_ST_SELECTED1: DrawSelected(rc, di.hdcDraw, hdcComp,1); m_eCardStatus = CSW_ST_SELECTED1; break; case CSW_ST_SELECTED2: DrawSelected(rc, di.hdcDraw, hdcComp,2); m_eCardStatus = CSW_ST_SELECTED2; break; default: _ASSERT(0); } DeleteDC(hdcComp); return S_OK; }