您现在的位置是: 首页 > 成语大全 成语大全

Drawstring 翻译-drawstring

tamoadmin 2024-10-25 人已围观

简介应该是绘画文字后,窗口重绘时清除了那一块区域。所以放窗体的Paint事件里就行了。Private?Sub?Form1_Paint(ByVal?sender?As?Object,?ByVal?e?As?System.Windows.Forms.PaintEventArgs)?Handles?Me.Paint ‘?在?Paint?事件参数中提供了?Graphics.?无需?Create.Using?

Drawstring 翻译-drawstring

应该是绘画文字后,窗口重绘时清除了那一块区域。

所以放窗体的Paint事件里就行了。

Private?Sub?Form1_Paint(ByVal?sender?As?Object,?ByVal?e?As?System.Windows.Forms.PaintEventArgs)?Handles?Me.Paint

'?在?Paint?事件参数中提供了?Graphics.?无需?Create.

Using?g?As?Graphics?=?e.Graphics

Dim?myfont?As?New?Font("微软雅黑",?50)

Dim?mybrush?As?New?SolidBrush(Color.Red)

g.DrawString("今天发工资啦!",?myfont,?mybrush,?10,?30)

End?Using

End?Sub

C#中使用DrawString绘制文本时怎样使文本居中或右对齐

楼上正解,之所以混在一起,是因为你没擦掉,0-0。擦掉的方法就同楼上所说,有两种:

1. super.paintComponent(g),会调用组件的原始界面重绘一次,这样你上次绘制上去的文本就不在了,也就相当于擦除了;

2. g.clearRect(x,y,w,h),这个就更直白了,就是擦除这个区域

string 和 thread 的区别

format.LineAlignment = StringAlignment.Center; // 更正: 垂直居中

format.Alignment = StringAlignment.Center; // 水平居中

RectangleF 排版框 = new Rectangle(Point.Zero, new Size(nWidth, nHeight));

g.DrawString(_ShowName, stringFont, Brushes.Black, 排版框, format);

C# DrawString函数,怎么有效限制绘制文字的宽度?

thread有时会表示针线的线(用毛/棉做的线),而string没有这种用法。但是表示绳子的时候,几乎相同,但是thread会比较细长,而string只是质量轻,没有对细度和长度方面的暗示。

详见以下英文释义

名词string:

1. a lightweight cord

同义词:twine

2. stringed instruments that are played with a bow

同义词:bowed stringed instrument

3. a tightly stretched cord of wire or gut, which makes sound when plucked, struck, or bowed

4. a sequentially ordered set of things or events or ideas in which each successive member is related to the preceding

同义词:train

5. a linear sequence of symbols (characters or words or phrases)

6. a tie consisting of a cord that goes through a seam around an opening

同义词:drawstring, drawing string

7. (cosmology) a hypothetical one-dimensional subatomic particle having a concentration of energy and the dynamic properties of a flexible loop

同义词:cosmic string

8. a collection of objects threaded on a single strand

9. a necklace made by a stringing objects together;

同义词:chain, strand

名词thread:

1. a fine cord of twisted fibers (of cotton or silk or wool or nylon etc.) used in sewing and weaving

同义词:yarn

2. any long object resembling a thin line

同义词:ribbon

3. the connections that link the various parts of an event or argument together

同义词:train of thought

4. the raised helical rib going around a screw

同义词:screw thread

java入门问题,用了drawString却不显示字串

Graphics 对象有 SetClip(Rectangle) 和 ResetClip() 两个方法,可以先通过前者指定一个有效绘图区域,绘制后再重置有效区域。

比如该 Graphics 的实际是 (0, 0, 200, 200),指定一个 (50, 50, 100, 100) 的矩形作为有效区域,那么超出该范围的部分不会被绘制在 Graphics 上。

Java中c.getGraphics().drawString()是什么意思?

因为 class PanelTest extends JPanel

{

public void PaintComponent(Graphics g)//方法名应该小写,才能重写。

{

super.paintComponent(g);

g.drawString("Hello Java", 75, 100);

}

所以,改为以下:class PanelTest extends JPanel {

public void paintComponent(Graphics g) {

super.paintComponent(g);

g.drawString("Hello Java", 75, 100);

}

就可以。

否则,不能重写该方法。

整句应该是

Image c=Image.createImage(128,128);

Graphics g=c.getGraphics();

g.drawString("string");

你可能就是

Graphics g=c.getGraphics();

这句不清楚

这句程序的意思是

得到c的画笔g,然后你在后面就可以用g来绘画这张c了