*Experts* Bucky Posted January 3, 2004 *Experts* Posted January 3, 2004 I'm trying to resize an image and paint it in a PictureBox in its Paint event, but the picture is supposed to be drawn regularly, not anti-aliased. Setting the SmoothingMode property to None has no effect; it's drawn fine, but it is still anti-aliased. How can I have it painted regularly, but still scaled up? Here's what I'm using ATM: private void pic_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; Rectangle dest = new Rectangle(xOffset * scale * -1, yOffset * scale * -1, bmp.Width * scale, bmp.Height * scale); // these are all form-level variables g.DrawImage(bmp, dest); // bmp is a form-level variable } Thanks. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
*Gurus* divil Posted January 4, 2004 *Gurus* Posted January 4, 2004 Have you tried fiddling with CompositingMode, CompositingQuality and InterpolationMode? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* Bucky Posted January 4, 2004 Author *Experts* Posted January 4, 2004 (edited) No such luck. In fact, I just realized that I cannot even change the properties of the Graphics object. Whenever I assign a value, the property doesn't even change to the value I try to assign to it. I had forgotten that e.Graphics is a read-only object. So, I take it I need to do the painting somewhere else, or find a way to alter the e.Graphics object. Which of these should I do, and how? Edited January 4, 2004 by Bucky Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.