drawtext

Draw text vertically on canvas

萝らか妹 提交于 2019-12-18 05:02:53
问题 I would like to learn how to draw vertical text on the canvas. Sorry for maybe stupid question, but I can not solve this problem. I can do so: if (i ==10) { this_str2 = "0.00"; } canvas.save(); canvas.rotate(-90,190,90); canvas.drawText(this_str2, x_guide +50, drawSizes[1] + drawSizes[3] - (i * drawSizes[3] / 10) +20, paint); canvas.restore(); } But it is not properly displayed on the X and Y is any other solution to this problem 7 回答1: Try this custom textview, I don't remember where I took

How do I use DrawText DT_CALCRECT properly?

爱⌒轻易说出口 提交于 2019-12-13 07:23:50
问题 I am generating a report that has a caption in the footer. I use DrawText to find out the caption's dimensions. The problem is the text is always clipped, but when I have a carriage return at the end of the text, all the text appears perfectly. lClientRect := Rect(0, 0, 4770, 59); lFlags := DT_CALCRECT or DT_EXPANDTABS or Alignments[Alignment] or WordWraps[WordWrap] or DT_NOPREFIX or DT_TOP or DT_EXTERNALLEADING; DrawText(lCanvas.Handle, PChar(lsCaption), Length(lsCaption), lClientRect,

FFMPEG - Moving text to appear every 'X' Seconds

泪湿孤枕 提交于 2019-12-13 07:16:36
问题 This is a ffmpeg command for moving text (left to right) ffmpeg -i input.mp4 -vf drawtext="fontfile=/path/to/fonts/FreeSans.ttf:text='Hello World':fontcolor=white@1.0:fontsize=16:y=h-line_h-100:x=(2*n)-tw" -codec:v libx264 -codec:a copy output.mp4 And I would like to know how to make the moving text to start after 'X' seconds and appear every 'X' seconds ? 回答1: It's right there in the documentation. For example to make it appear every 3 seconds for a duration of 1 second you can add the

How to Render text to bitmap and draw it

谁说胖子不能爱 提交于 2019-12-12 15:23:18
问题 I am new to android, and my group is currently creating a graphing application using a GlSurfaceView using opengl es 2.0. We have recently displayed the grid and tickmarks on the plot and now I have been assigned the task to implement a numeric scale and labeling the x and y axis as "X" and "Y". After doing a lot of research I have determined to accomplish this by rendering a string of characters to a bitmap. I have encountered many problems in achieving this. I understand the basic concept.

how to create array of numbers in range 1 to 100 in view class

元气小坏坏 提交于 2019-12-12 04:54:43
问题 everyone, Please help me! I want to show an array of numbers in a shape. What I did 1) I draw a shape with canvas in View class. 2) I create a single random number. 3) I've searched a lot & find out that should use Drawtext to show a text or number. 4) I've read the documentation of Random, Drawtext, etc. 5) I've tried for loop but it didn't work outside of canvas class & inside, also will repeat that single number infinite times. my Problem I don't know how to put that number in an array &

How can I use DrawText() to display a variable?

匆匆过客 提交于 2019-12-12 01:39:37
问题 I can draw a string literal via DrawText() : DrawText (hdcWindow, "abc123", -1, &rc, DT_SINGLELINE); However, this doesn't work with anything else. Specifically, I can't output the value stored in a variable, such as an int : int variable = 5; DrawText (hdcWindow, variable, -1, &rc, DT_SINGLELINE); Or a char : char variable = a; DrawText (hdcWindow, variable, -1, &rc, DT_SINGLELINE); How can I use DrawText() to display the contents of a variable? Why does using a string literal like "abc123"

Scripting FFmpeg to move text in y co-ordinate by some delta at specific time-codes

大城市里の小女人 提交于 2019-12-11 19:03:48
问题 I'm using the basic drawtext command like this ffmpeg -i output.mp4 -vf \ 'drawtext=textfile='textfile.txt':x=0:y=0 \ :fontsize=30:fontcolor=white:borderw=3 \ :bordercolor=black:box=0' output.mp4" which puts stationary text at location (x, y) = (0,0) What I want to do is move this text by 10 points in y plane at certain time codes. at 00:00:10, y would be 0 at 00:00:11, y would be 10 at 00:00:43, y would be 20 ... ... at 00:10:44, y would be 30 so the 'y' co-ordinate has a fix increment of 10

ffmpeg drawtext support for Hindi fonts

丶灬走出姿态 提交于 2019-12-11 18:51:39
问题 We are trying to use ffmpeg drawtext to support hindi fonts. But the ordering of the data is not correct. The unicode for Hindi text is passed like this 1. पिता माता िस्रफ But output renders as Output of code Have used the following code for generating the output ffmpeg -framerate 30 -t 10 -i /opt/test.png drawtext=text_shaping=1:fontcolor=white:fontsize=60:fontfile=/usr/share/xx.ttf:text='1. पिता माता िस्रफ':y='max(550,700-t*200)':x=40,format=yuv420p[v] /usr/share/nginx/html/hello_v.mp4 Had

Making jumping text watermark

北慕城南 提交于 2019-12-11 13:16:13
问题 I want to make something like these : http://www.youtube.com/watch?v=AtM-f20XV4E you can see there a watermark which change position every two second... But I need it for drawtext filter. So, I am already realize how to change a text position every few seconds.. but have no idea - how to keep new position :) there is a code which I have right now.. ffmpeg.exe -i myVideo.mov -c:v libx264 -preset veryfast -crf 25 -tune zerolatency -vendor ap10 -pix_fmt yuv420p -filter:v drawtext=fontfile=arial

Psychtoolbox - Text for Instruction [closed]

五迷三道 提交于 2019-12-11 10:58:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 months ago . I have some problems using Psychtoolbox Screen and Textwindow... For my experiment I want to give an instruction at the beginning. I used something like this: % Draw text in the middle of the screen in Courier in white Screen('TextSize', window, 20); Screen('TextFont', window, 'Courier'); DrawFormattedText