RDLC报告中的“反转或翻转文本”

问题描述

| 好的,我学到了更多知识,并改写了我的问题。我需要将RDLC报告上的文本翻转或翻转180度(因此显示为上下颠倒)。我有一些自定义的VB代码,该代码接受文本,将其转换为位图,然后将画布翻转180度。这样的效果使文本看起来有点..抖动...或模糊。它不再是一种尖锐的字体。我遇到的问题是我正在使用特殊的TTF条形码字体,该字体创建了扫描仪可以读取的内容。当我翻转条形码字体时,由于条形码行之间的距离太近且扫描仪无法读取,因此模糊性不好。这是代码:
Function LoadImage(ByVal sImageText as String,iRotationAngle as Integer,ByVal sFontName as String,iFontSize as Integer)
Dim bmpImage As New Drawing.Bitmap(1,1)
Dim iWidth As Integer = 0
Dim iHeight As Integer = 0

\'// Create the Font object for the image text drawing.
Dim MyFont As New Drawing.Font(sFontName,iFontSize)  \',System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point)

\'// Create a graphics object to measure the text\'s width and height.
Dim MyGraphics As Drawing.Graphics = Drawing.Graphics.FromImage(bmpImage)

\'// This is where the bitmap size is determined.
iWidth = MyGraphics.MeasureString(sImageText,MyFont).Width
iHeight = MyGraphics.MeasureString(sImageText,MyFont).Height

\'// Create the bmpImage again with the correct size for the text and font.
bmpImage = New Drawing.Bitmap(bmpImage,New Drawing.Size(iWidth,iHeight))

\'// Add the colors to the new bitmap.
MyGraphics = Drawing.Graphics.FromImage(bmpImage)
MyGraphics.Clear(Drawing.Color.White)
MyGraphics.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
MyGraphics.TranslateTransform(iWidth,iHeight)
MyGraphics.RotateTransform(iRotationAngle)
MyGraphics.DrawString(sImageText,MyFont,New Drawing.SolidBrush(Drawing.Color.Black),0)
MyGraphics.Flush()

Dim stream As IO.MemoryStream = New IO.MemoryStream
Dim bitmapBytes As Byte()

\'Create bitmap 
bmpImage.Save(stream,System.Drawing.Imaging.ImageFormat.Bmp)
bitmapBytes = stream.ToArray
stream.Close()
bmpImage.Dispose()

Return bitmapBytes

End Function
我真的不知道为什么没有内置的方式来翻转文本。它会让我从左到右反转它。荒谬。 谢谢     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...