예제 #1
0
/*! \brief Draw the aquarium
 * \param dc The device context to draw onto
 */
void CAquarium::OnDraw(wxDC &dc)
{
     // Create a font
     wxFont font(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false);
     dc.SetFont(font);
     dc.SetTextForeground(wxColour(255, 255, 255));

     dc.DrawBitmap(mBackground, 0, 0, true);
     dc.DrawText(L"Under the Sea!", 2, 2);
     
     if (mItems.size() != 0)
     {
     
     for(list<CItem *>::iterator t=mItems.begin(); t!=mItems.end(); t++)
     {
         //cout << "Num items " << mItems.size() << endl;
         CItem *item = *t;
         item->Draw(dc);
         }
         
     }
     if (mTrashCanActive == true)
     {
         dc.DrawBitmap(mTrashcan,0,0);
     }
}
예제 #2
0
파일: TextBox.cpp 프로젝트: mygaldre/mmsstv
HBITMAP mcmUpdateText(HANDLE hObj, HBITMAP hDest, LPCSTR pText)
{
	ASSERT(hObj);
	ASSERT(hDest);
	CItem *pItem = (CItem *)hObj;

	// Draw object to hDest
	Graphics::TBitmap *pDest = new Graphics::TBitmap;
	pDest->Handle = hDest;
	pDest = pItem->Draw(pDest, pText);

	HBITMAP hb = pDest->ReleaseHandle();
	delete pDest;
	return (hb != hDest) ? hb : NULL;
}