Questions tagged [drawtext]

340 questions
2
votes
1 answer

DrawText with DT_CALCRECT and DT_RIGHT does not work

I have the following code in an otherwise default VisualStudio project. It passes DT_CALCRECT to DrawTextW to calculate the rectangle to draw some text, then it uses that rectangle to draw the text. To test it yourself just paste this code into a…
Alice
  • 23
  • 1
  • 3
2
votes
1 answer

How can I make drawText() to position accurately?

I have made several tests to position text on a given location on the canvas and come to the conclusion that drawText() does not work correctly. (My sample code and screenshot will show.) If possible, please give me an advice how this can be…
Peter Mattheisen
  • 117
  • 2
  • 13
2
votes
1 answer

ffmpeg failing to expand drawtext

I am trying to overlay a seconds:milliseconds timestamp on my video, but I have been breaking my head over this for some hours without any result. If I write: ffmpeg -f lavfi -i testsrc=duration=5:size=800x600:rate=30 -vf…
charlie80
  • 806
  • 1
  • 7
  • 17
2
votes
2 answers

Cannot print a text with Gosu in Ruby (crash)

I'm trying to learn some basics of Gosu. I can display images but when i try with text the application crashed. Here's a simple code i'm trying to run. require 'gosu' class GameWindow < Gosu::Window def initialize(width=320,…
2
votes
0 answers

TMetaFileCanvas and DrawTextEx with DT_RIGHT flag and Arial font

My program must use TMetaFile objects to draw text on a TImage. To do this i call system function "DrawTextEx". When I assign the "Arial" font and right alignment (flag DT_RIGHT) the text is truncated at the end only if the string contains lots of …
blackmes4
  • 140
  • 10
2
votes
2 answers

canvas draw text- cant get strings

String str = new String(); str = "111"; x = width / 2; y = Math.round(height / 1.3); while (pressed != true){ if (!holder.getSurface().isValid()) continue; Canvas c = holder.lockCanvas(); c.drawBitmap(galaxy, 0, 0, null); …
ItaN
  • 43
  • 6
2
votes
0 answers

DirectX DrawText doesn't work

I have been learning DirectX and Windows programming for a short time now. However, I have a problem with the DirectX function DrawText. Somehow it doesn't display text in the window, and cannot figure out why. Here is my…
2
votes
0 answers

How is the LOGFONT quality value set for the TextRenderer

HELP! I'm working on a C# web app where I am drawing on to a bit map. There are two ways to draw text: 1. Graphics.DrawString 2. TextRenderer.DrawText According to the internet TextRenderer is the "newer way" but there are times where it looks worse…
2
votes
1 answer

c++ DrawText() font color and background color

How do I change the text color and font background color that is displayed when I use the DrawText() function? Whenever I use the DrawText() function, I always output a present font as well as a "white" background color. I understand to change the…
CodeBlocks
  • 233
  • 3
  • 5
  • 14
2
votes
2 answers

android canvas draw text partial

on a canvas is it possible to draw text but make half of it not show up (as if it is being drawn partially off of the canvas, but actually not being off the canvas). i have an indicator on a "graph" with some text and it follows the point but I do…
user1
  • 599
  • 1
  • 3
  • 20
2
votes
0 answers

Canvas drawText method to animation

I'm currently developing 2D android game. And when I comes to score, I used canvas drawText method to display my current score in the middle of screen. I didn't use any layout xml file, my background is render by canvas. The position done by canvas.…
user3691561
  • 31
  • 1
  • 3
2
votes
1 answer

WinApi DrawText and TextOut cannot display unicode character U+5167

Hello Windows Programmers! I am new to windows programming using winapi. I was reading this very nice book and I encountered a problem(displayed as a black box) when I display unicode character U+5167 (內) in the client area using DrawText and…
wembikon
  • 91
  • 2
  • 9
2
votes
0 answers

Qt for iOS QPainter::drawText hangs for a few seconds first time it is called

I'm using Qt for iOS 5.2 and when trying to draw text using QPainter, it will hang on that call for a few seconds (5 seconds on iPhone4 and around 3 on OSX). After that first time, it won't block anymore if I call it again. QImage image(QSize(200,…
EiN
  • 121
  • 1
  • 6
2
votes
2 answers

How to alter the output of Android Canvas.drawTextOnPath()

I'm new in Android and I've written the following sample code. public class Circle extends View { Paint paint = new Paint(); Path path = new Path(); private static final String s = "Hello world example"; public Circle(Context…
Ibungo
  • 1,137
  • 12
  • 23
2
votes
3 answers

Android drawTextOnPath() is not displaying the output

I've the following code below. public class CompassActivity extends Activity { public class OuterCircle extends View { Paint paint = new Paint(); Path path = new Path(); private static final String s = "Hello world example"; …
Ibungo
  • 1,137
  • 12
  • 23