My view is inherited from CScrollView, I want to know how can I scroll the view when the picture is so big inside the view?  
Author Message
su45937





PostPosted: Visual C++ General, My view is inherited from CScrollView, I want to know how can I scroll the view when the picture is so big inside the view? Top

My view is inherited from CScrollView, I want to know how can I scroll the view when the picture is so big inside the view



Thanks.





Visual C++3  
 
 
Simple Samples





PostPosted: Visual C++ General, My view is inherited from CScrollView, I want to know how can I scroll the view when the picture is so big inside the view? Top

Please try to be specific enough for us to understand.

I don't understand why you need to scroll just because the picture is big. Normally the user scrolls when they need to. Normally we don't need to know why the image needs to be scrolled, so I don't understand why you mention it; I assume there is an explanation why you mention it but I don't understand why.

Are you saying there are no scroll bars



 
 
Viorel.





PostPosted: Visual C++ General, My view is inherited from CScrollView, I want to know how can I scroll the view when the picture is so big inside the view? Top

 

My view is inherited from CScrollView,  I want to know how can I scroll the view when the picture is so big inside the view

Thanks.

I think you should set the size of your scrollable area using SetScrollSizes member of your view:

CSize size = ... // size of your picture in pixels

SetScrollSizes(MM_TEXT, size);

For information about the proper place for doing this, see the documentation for SetScrollSizes function: http://msdn2.microsoft.com/en-us/library/3ew6s3ez(VS.71).aspx.

 

I hope it works.