如何制作绘制到PictureBox的文本的镜像 [英] How to Make a Mirror of a Text Drawn to PictureBox
本文介绍了如何制作绘制到PictureBox的文本的镜像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好:)
我有一个问题...
我来解释一下.
绘制文本的代码:
Hi everyone :)
I have a question...
Let me explain it.
Code to draw texts:
for (int z = 0; z < base.CellNumber(); z++)
{
Rectangle rect = new Rectangle(((base.Hucreler[z].x / ScaleFactor - base.Hucreler[z].r / ScaleFactor)
* ZoomKontrolCarpan) / base.ZoomKontrolBolen, (base.Hucreler[z].y / ScaleFactor - base.Hucreler[z].r / ScaleFactor) *
ZoomKontrolCarpan / base.ZoomKontrolBolen, (2 * base.Hucreler[z].r / ScaleFactor) * ZoomKontrolCarpan / base.ZoomKontrolBolen
, (2 * base.Hucreler[z].r / ScaleFactor) * ZoomKontrolCarpan / base.ZoomKontrolBolen);
g.DrawEllipse(Kalem, rect);
}
效果很好,可以绘制单元格ID.
我想做的是对文本进行镜像,因为我在某处使用
This works great, draws cell ids.
What I want to do is to make mirror of the texts, because of I use
BitMap.RotateFlip(RotateFlipType.Rotate180FlipX)
代码,该代码可以旋转整个图像,并且我的文本看起来像是镜像的:/
你有什么主意吗?需要紧急帮助:/
我最好的问候...
code somewhere which takes the rotation of whole image and my texts seen like mirrored :/
Do you have any idea? Need Urgent help :/
My best Regards...
推荐答案
下面的代码显示给定的文本及其在图片框中的镜像位置.
在这里我正在使用System.Drawing.Drawing2D.Matrix
类
below code shows the given text and their mirror position in picture box.
Here i''m usingSystem.Drawing.Drawing2D.Matrix
class
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics graphics = e.Graphics;
graphics.DrawString("Ambarish!", Font, Brushes.Black, 0, 0);
// Transform graphics and draw string again.
graphics.MultiplyTransform(new Matrix(1, 0, 0, -1, 0, 40));
graphics.DrawString("Ambarish!", Font, Brushes.Black, 0, 0);
// Reset transform
graphics.ResetTransform();
}
关于矩阵类 [
About Matrix Class[^]
您具有椭圆的位置,并且具有文本,可以使用WriteString(或DrawString,我忘记了)来编写文本.那么,问题出在哪里?
You have the position of the ellipse, and you have the text, which you can write with WriteString ( or DrawString, I forget ). So, where is the issue ?
这篇关于如何制作绘制到PictureBox的文本的镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文