PC Review


Reply
Thread Tools Rate Thread

Distorted image when scrolling in DoubleBufferPanel

 
 
moss
Guest
Posts: n/a
 
      3rd Sep 2009
Hi,
i have a UserControl called DoubleBufferPanel which is a typical Panel
but is set to be DoubleBuffered by the SetStyle() method. I draw my
images on that Panel and no clipping occurs, but when I set it to
AutoScroll and begin scrolling, the image becomes distorted like this:
http://www.flickr.com/photos/37459057@N04/3882558185/

When I resize the form which contains the panel and when I size the
image to fit the panel's dimensions everything is ok, but when I
scroll in any direction this kind of distortion keeps appearing. I
used this code to set the AutoScroll and draw the image:

this.imagePanel.AutoScroll = true;
this.imagePanel.AutoScrollMinSize = MyBitmap.Size;
g.DrawImage(MyBitmap, new RectangleF
(this.imagePanel.AutoScrollPosition.X, this.AutoScrollPosition.Y,
MyBitmap.Width, MyBitmap.Height));

What is the cause of this problem and how can it be solved?
 
Reply With Quote
 
 
 
 
mick
Guest
Posts: n/a
 
      3rd Sep 2009

"moss" <(E-Mail Removed)> wrote in message
news:7ce4bfb6-f4d0-451f-83ab-(E-Mail Removed)...
> Hi,
> i have a UserControl called DoubleBufferPanel which is a typical Panel
> but is set to be DoubleBuffered by the SetStyle() method. I draw my
> images on that Panel and no clipping occurs, but when I set it to
> AutoScroll and begin scrolling, the image becomes distorted like this:
> http://www.flickr.com/photos/37459057@N04/3882558185/
>
> When I resize the form which contains the panel and when I size the
> image to fit the panel's dimensions everything is ok, but when I
> scroll in any direction this kind of distortion keeps appearing. I
> used this code to set the AutoScroll and draw the image:
>
> this.imagePanel.AutoScroll = true;
> this.imagePanel.AutoScrollMinSize = MyBitmap.Size;
> g.DrawImage(MyBitmap, new RectangleF
> (this.imagePanel.AutoScrollPosition.X, this.AutoScrollPosition.Y,
> MyBitmap.Width, MyBitmap.Height));
>
> What is the cause of this problem and how can it be solved?


Looks like it`s redrawing the image without clearing the previous one.
I`ve just tried to set this up but no matter what size image I put into the
panel no scroll bars appear. Wierd.

mick

 
Reply With Quote
 
moss
Guest
Posts: n/a
 
      3rd Sep 2009
On 3 ruj, 15:07, "mick" <coughco...@privacy.com> wrote:

> Looks like it`s redrawing the image without clearing the previous one.
> I`ve just tried to set this up but no matter what *size image I put into the
> panel no scroll bars appear. Wierd.
>
> mick


I posted the original thread to another group (sorry for
multiposting), this is the other discussion:
http://groups.google.com/group/micro...9c061f5e22b854
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Distorted image when scrolling in DoubleBufferPanel moss Microsoft C# .NET 10 4th Sep 2009 12:51 AM
Image and text distorted =?Utf-8?B?RG9kb2U=?= Windows XP Hardware 2 4th Mar 2007 01:05 PM
Distorted image myname Windows XP Games 1 6th Feb 2007 05:57 AM
distorted image =?Utf-8?B?YXY0MzA=?= Windows XP MovieMaker 2 19th Apr 2006 01:49 AM
image on monitor distorted... =?Utf-8?B?VUFJ?= Windows XP General 1 30th May 2005 10:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:30 AM.