Click to See Complete Forum and Search --> : Bitmap display


vsspro
July 5th, 2007, 07:59 PM
Hi,

I am working in a project which needs to do different sorts of things with bitmaps.I have to zoom in and zoom out and also I have to scroll a bitmap if it is larger than window dimensions .

My problem is with scrolling.I am not able to find the max value and it is scrolling past the bitmap which makes my program halt in a bad way.can anyone give me the solution.

Thanks.

VladimirF
July 5th, 2007, 08:06 PM
...which makes my program halt in a bad way.can anyone give me the solution.So you want it to halt in a good way instead? ;)
Seriously, you have to show how do you zoom and scroll, and how you figure how far to scroll.

vsspro
July 5th, 2007, 08:08 PM
you mean i have to post the code

VladimirF
July 5th, 2007, 08:17 PM
you mean i have to post the code
I do...
Or do you want us to guess what's going on?

VladimirF
July 6th, 2007, 01:34 PM
...I am not able to find the max value...I would need to see HOW you are calculating that max value. Is it in your setupsbars() function?
Regarding your code - for SB_TOP, SB_BOTTOM and SB_THUMBPOSITION you simply recalculate new scroll position and invalidate the whole window, but for SB_LINEUP and SB_LINEDOWN you are painting your dc right there. Why is that? Also, you use StretchBlt() there, but it looks like your in-memory bitmap was already stretched (in your zoom function).
May be you should post your entire (zipped) project here?