Bucky
Well-known member
Im 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; its drawn fine, but it is still anti-aliased.
How can I have it painted regularly, but still scaled up?
Heres what Im using ATM:
Thanks.
Paint event, but the picture is supposed to be drawn regularly,
not anti-aliased. Setting the SmoothingMode property to None
has no effect; its drawn fine, but it is still anti-aliased.
How can I have it painted regularly, but still scaled up?
Heres what Im using ATM:
C#:
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.