result MessageDocElement::OnDraw() {
	Canvas *pCanvas = GetCanvasN();

	if (pCanvas) {
		pCanvas->DrawNinePatchedBitmap(pCanvas->GetBounds(), *_pBitmap);

		delete pCanvas;
	}

	return E_SUCCESS;
}
Ejemplo n.º 2
0
result MessageBubble::OnDraw(void) {
	result r = E_SUCCESS;

	Canvas* pCanvas = GetCanvasN();
	Dimension screenSize = GetSize();
	Bitmap* pBubble;

	pBubble = (out == 1) ? pBubbleOut : pBubbleIn;

	// TODO: paddigns
	r = pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, screenSize.width, screenSize.height), *pBubble);
	TryCatch(r == E_SUCCESS, , "Failed DrawNinePatchedBitmap");

	delete pCanvas;
	return r;

CATCH:
	AppLogException("$${Function:OnDraw} is failed.", GetErrorMessage(r));
	delete pCanvas;
	return r;
}