Re: Scrolling a picture box.

Tech-Archive recommends: Fix windows errors by optimizing your registry



It's already been done. Take a look at the ImageViewer control:

http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=e0786a7b-935c-4e46-b6c5-0100af4bcf47

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org

"David D Webb" <spivey@xxxxxxxxxxxxxxx> wrote in message
news:uAzwWnfIGHA.3856@xxxxxxxxxxxxxxxxxxxxxxx
>I am trying to scroll a picture larger than the screen.
>
> I have a form with a panel on it (240H). On this panel, I have a picture
> box that is larger than the panel (960H). I have a vertical scroll bar on
> the form next to the panel. Changing the scrollbar moves the picture box
> up and the panel defines the viewing area:
> this.pboxWeekCal.Top = -(this.vScrollBar.Value * 40);
>
> Now, I didn't think the picture box would handle the clipping and
> redrawing correctly. But I thought it would only have a blank area where
> the new region came into view from the scrolling. What is happening
> though, is the entire picturebox goes blank by just moving the scrollbar
> one change value. Is the default paint event wiping it clear or something
> like that? Is there a better way to do this. I have an offscreen bitmap
> that I can buffer from, and worse case scenario, I'll redraw the entire
> viewable region for every scroll change - in that case I'll just get rid
> of the picturebox and copy onto the first panel directly.
>
> Thanks,
>
> Dave
>
> Using Visual Studio 2003 and .NET CF sp2.
>
>
>
>
>


.


Quantcast