System.Windows.Forms.Label(); big fonts Antialised HOWTO?

  • Thread starter Thread starter Michael Böckinghoff
  • Start date Start date
M

Michael Böckinghoff

Hello NG!

The code below shows a label with the text "label1" with the fontzise 72.

On the regular framework 2.0 this text is shown antialised. (the round
shapes are looking better using some grey dots on the corners)

http://de.wikipedia.org/wiki/Antialiasing

But in the compact framework 2.0 this text is alised.

Is their any way to show this text antialised in the compatframework?



TIA!

Michael

#####################################################

Codesnipet:



this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("Tahoma", 72F,
System.Drawing.FontStyle.Regular);
this.label1.Location = new System.Drawing.Point(165, 102);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(393, 228);
this.label1.Text = "label1";
 
You can't do this with the designer, but you can from code e.g.:-

Microsoft.WindowsCE.Forms.LogFont lf = new
Microsoft.WindowsCE.Forms.LogFont();
lf.FaceName = "Tahoma";
lf.Height = 16;
lf.Quality = Microsoft.WindowsCE.Forms.LogFontQuality.ClearType;
label1.Font = Font.FromLogFont(lf);

The height is not in point size so you'll have to find the right height to
be equivalent to your existing text.

Peter
 
Peter Foot said:
You can't do this with the designer, but you can from code e.g.:-

Microsoft.WindowsCE.Forms.LogFont lf = new
Microsoft.WindowsCE.Forms.LogFont();
lf.FaceName = "Tahoma";
lf.Height = 16;
lf.Quality = Microsoft.WindowsCE.Forms.LogFontQuality.ClearType;
label1.Font = Font.FromLogFont(lf);

The height is not in point size so you'll have to find the right height to
be equivalent to your existing text.

Ah thank you I will try this out!

Regards

Michael
 
Back
Top