L
Lev Elbert
Using DrawImage I draw (in OnPaint) a bitmap on a form
protected override void OnPaint(PaintEventArgs e)
{
if (_album.Count > 0)
{
// Paint the current image
Photograph photo = _album.CurrentPhoto;
Graphics g = e.Graphics;
......
g.DrawImage(photo.Image, this.DisplayRectangle);
}
All works, but when I drug the corner of the form (resize the form i
horizontal direction) the picture is redrawn incorrectly. Namely: it
should be stretched, but instead of stretching it draws some pieces of
the original image several times. It stretches too, but also repeats
the fragments. The effect is "accumulative". I other words: the more
you move, the more junk you see.
xppro, sp2, net 1.1, vs 2003
protected override void OnPaint(PaintEventArgs e)
{
if (_album.Count > 0)
{
// Paint the current image
Photograph photo = _album.CurrentPhoto;
Graphics g = e.Graphics;
......
g.DrawImage(photo.Image, this.DisplayRectangle);
}
All works, but when I drug the corner of the form (resize the form i
horizontal direction) the picture is redrawn incorrectly. Namely: it
should be stretched, but instead of stretching it draws some pieces of
the original image several times. It stretches too, but also repeats
the fragments. The effect is "accumulative". I other words: the more
you move, the more junk you see.
xppro, sp2, net 1.1, vs 2003