Understanding Drawing.Text.TextRenderingHint.SingleBitPerPixel

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

PictureControl1 is basicly a PictureBox and g is a Graphics object for the
Picturebox.

For large fonts (33) it works OK. For smaler fonts (10) there are touches of
red around the letters.

Maybe antialiasing is doing it.

I tried Drawing.Text.TextRenderingHint.SingleBitPerPixel

Gets rid of the red.

Does that turn off antialiasing?

The text does not look good with SingleBitPerPixel

Anyway better way I can get rid if that extra color?



Thanks

g.Clear(Color.Red)

g.TranslateTransform(PictureControl1.PicWidth / 3, PictureControl1.PicHeight
/ 3)

g.RotateTransform(45)

g.DrawString("Test", New Font("Arial", 10), Brushes.Yellow, 0, 0)

PictureControl1.PicMakeTransparent(Color.Red)
 
* " Just Me said:
PictureControl1 is basicly a PictureBox and g is a Graphics object for the
Picturebox.

For large fonts (33) it works OK. For smaler fonts (10) there are touches of
red around the letters.

Maybe antialiasing is doing it.

Play around with your 'Graphics' object's 'SmoothingMode' property.
 
I did and it looks like SingleBitPerPixel means: Do not use antialiasing.
But looks can be deceiving and I was looking for confirmation.

Thanks

PS I notriced I had SingleBitPerPixel in the subject but not in the body -
I should have included it in the body.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top