Note that there are some explanatory texts on larger screens.

plurals
  1. POInvert or Flip Text in RDLC report
    primarykey
    data
    text
    <p>Okay, I've learned a bit more and have rephrased my question. I've got a need to flip or invert text 180 degrees (so it appears upside-down) on a RDLC report. I have some custom VB code that takes the text, converts it to a bitmap, then flips the rotates the canvas 180 degrees. The effect of this makes the text look a bit.. dithered... or fuzzy. It's not a sharp font anymore. The problem I'm experiencing is I'm using a special TTF Barcode font that creates something a scanner can read. When I flip the barcode font, the fuzziness isn't good since the barcode lines are so close together and the scanner cannot read it. Here's the code:</p> <pre><code>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, 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 </code></pre> <p>I really dont know why there's not a built-in way to just flip text. It'll let me reverse it left-to-right. Ridiculous.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload