drawtext

Qt, Getting the text when QPainter::drawText() is called

Hey, I have a QPainter object and would like to obtain the string that is drawn whenever QPainter::drawText is called, as I would if I could connect a slot to that signal (which doesn't exist, so I can't). What would be the best way to do this? I have read some stuff about redirecting the drawText method to a custom one using the setPro...

I3D3XFont::DrawTextW - Expanding tabs wrong?

I'm wondering if it's an issue with I3D3XFont::DrawTextW, I pass it a string with \t in it, which it expands. However, it doesn't always do it correctly. If I print the same string that I pass to it, the tabs are expanded correctly. For example, dxfont->DrawTextW(NULL, msg, wcslen(msg), &textbox, DT_LEFT | DT_TOP | DT_EXPANDTAB...

How do I make a triangle space with text written for the iPhone?

I want to draw a triangle and elide text in the shape. I can restrict the triangle to an equilateral triangle and a fixed orientation ('upside down' or 'upside up'). Then I want to insert arbitrary text in the triangle such that the eliding is on word boundaries and not clipped. Any simple algorithms? What methods are available in Ob...

Drawing text at an angle (e.g. upside down) in Android

I'm trying to build a custom clock view in Android. See image http://twitpic.com/1devk7 So far to draw the time and hour markers I have been using the Canvas.rotate method to get the desired effect. However, notice that it is difficult to interpret the numbers in the lower half of the clock (e.g. 6 or 9?) because of the angle in which t...

Android Canvas.drawText

Hi All, I have a view, I'm drawing with the Canvas object in the onDraw(Canvas canvas) method. My code is: Paint paint = new Paint(); paint.setColor(Color.WHITE); paint.setStyle(Style.FILL); canvas.drawPaint(paint); paint.setColor(android.R.color.black); paint.setTextSize(20); canvas.drawText("Some Text", 10, 25, paint); The problem...

When using DrawText, what does TextFormatFlags.Internal (a.k.a. DT_INTERNAL) do?

When using TextRenderer.DrawText(), what does setting the TextFormatFlags.Internal flag actually do? Equivalently, what does setting the DT_INTERNAL flag to Win32's DrawTextEx() function do? More to the point, when should I set that flag and when should I not set it? The documentation says: "Uses the system font to calculate text metr...

How to position StaticLayout in android?

I want to created a wrapping text ontop of google maps api. I have been able to do this with a lot of code, but have been working on a better way. My latest attempt is to use the StaticLayout class and the text is wrapping, but I do not know how to position it...no matter what I try it is always starting in the top left corner of the s...

Android Canvas.drawString display problem

Hello everyone! I encounter this problem when displaying text on SurfaceView, some chars can climb up on others, code is here: private static void fakeDraw(Canvas c) { Paint mPaint = new Paint(); int color = 0xff000000; mPaint.setColor(color); mPaint.setStrokeWidth(2); mPaint.setStyle(Style.FILL); mPaint.setAnti...

Android: Canvas.drawText when button click

How to drawText when button click? How can i setContentView(R.layout.main) to see the button and draw the text when button click? I cannot make it, and below is my code for drawing text.public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); drawView = new DrawView(this); setContentView(drawView); } ...

DrawText(), DT_LEFT and colons moving to beginning of text???

Hi, on some PCs I am finding that my calls to DrawText() result in colons being placed at the start of the text. dc.DrawText( "Name:", &rText, DT_LEFT | DT_VCENTER | DT_WORDBREAK ); The output on my PC is Name: But on one PC in particular it is: :Name If I change DT_LEFT to DT_CENTER the colon appears at the end where it should...

Blackberry - text wrapping to a specific number of lines

I remember asking this question earlier this year as seen in this post. However, that one only wrapped text for up to two lines max. What I want to create is a function that would wrap text up to n number of lines greater than zero (or completely wrap text around the specified width if passing -1 as the argument). In other words, how wo...

why my invoke of Canvas.drawText() just doesn't work

Hi all: I'm writing a class that inherit from TextView, and override its onDraw() method, but in the method, my invoke of canvas.drawText() doesn't seems to work, the code just like below: protected void onDraw(Canvas canvas) { // super.onDraw(canvas); Paint paint = new Paint(); paint.setColor(android.graphics.Color.WHITE...