
Originally Posted by
Sufo
Wondering if there is a way, or rather, what the best way is to draw text with variables. The DrawText() function from CGraphicsContext doesn't seem to to allow for specifiers like printf for example. Let's say i wanted to have a variable where the specifier is in the code below, would i have to draw it next to it, using a different function?
_LIT(KExampleText,"Number: %d\n");
iBmpGc->DrawText(KExampleText,pos);
cheers
Hi,
Code:
TInt value = 3;
TBuf<32> buf; // it is not good to use a magic number here
buf.Format(KExampleText, value); // "Number: 3\n"
iBmpGc->DrawText(KExampleText, pos);
Regards
Ziteng Chen