Advertisement
Advertisement
| 07.12.2008 at 02:10PM PDT, ID: 23560042 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: |
// Creates a square with a circle in the middle. Bitmap tn = new Bitmap(30, 30); Graphics gForm = Graphics.FromImage(tn); gForm.CompositingMode = CompositingMode.SourceOver; gForm.CompositingQuality = CompositingQuality.HighQuality; gForm.SmoothingMode = SmoothingMode.HighQuality; ; // Draw the background. Brush BackBrush = new SolidBrush(Color.IndianRed); gForm.FillRectangle(BackBrush, 0, 0, tn.Height, tn.Width); BackBrush.Dispose(); Brush FillBrush = new SolidBrush(Color.BlueViolet); gForm.FillEllipse(FillBrush, 10, 10, 10, 10); FillBrush.Dispose(); tn.Save(OutputFolder + @"test.jpg", ImageFormat.Jpeg); //too blury! tn.Save(OutputFolder + @"test.Gif", ImageFormat.Gif); // too dithered! tn.Save(OutputFolder + @"test.Png", ImageFormat.Png); // IE7 problem! |