RadioButtonRenderer und AntiAliasing?
-
Moin
Ich versuche hier eine Bildmap in einer DataGridViewCell darzustellen. Sie soll einen Radiobutton simulieren. Dafür nehme ich mir den RadioButtonRenderer und zeichne mit seiner statischen Methode DrawRadioButton einen derartigen Button in meine Bitmap.
Leider sieht das ziemlich bescheiden aus:
siehe hier: http://www.bilder-hochladen.net/files/g17p-1.jpgIch habe eine Linie daneben gemalt, die zeigt, dass Anti-Aliasing bereits eingeschaltet ist und funktioniert.
public class RadioButtonCell : DataGridViewImageCell { static Image[] _images = new Image[2];// load up images public RadioButtonCell() { this.ValueType = typeof(bool); RadioButtonState _rbState = RadioButtonState.UncheckedNormal; // list and pre-init check state. Graphics gfx; Bitmap bmp; for (int i = 0; i <= 1; i++) { bmp = new Bitmap(24, 24, System.Drawing.Imaging.PixelFormat.Format32bppArgb); // creating a new bitmap gfx = Graphics.FromImage(bmp); // and getting graphics object from gfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; gfx.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; gfx.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; gfx.DrawLine(Pens.Blue, 0, 0, 5, 20); switch (i) { case 0: _rbState = RadioButtonState.UncheckedNormal; break; case 1: _rbState = RadioButtonState.CheckedNormal; break; } RadioButtonRenderer.DrawRadioButton(gfx, new Point(5, 5), _rbState); _images[i] = bmp; } } ...
Kann mir jemand sagen, wieso der RadioButtonRenderer nicht auf AntiAliasing bzw. "HighQuality" reagiert? (der Quelltext ist durch diverse Experimente etwas versaut)
Und noch viel interessanter: Kann mir jemand einen Tipp geben, wie ich aus diesen klobigen Dingern ansehnliche RadioButtons bekomme?Vielen Dank!