Hello

I'm trying to display an ... let's say 1024x768 resolution image on a
640x480 Pocket PC. If i use BitBlt(), it will only display the x=0,
y=0, width = 480, height = 640 of it. I need to use something to
automatically display scrollbars to let me view my whole image. Is
there anything like this in Win32 API?

Regards

Re: Image+ScrollBars by AB

AB
Tue Jan 16 07:46:51 CST 2007

Perhaps there exists a control in MFC, but for Win32...you have to draw
the bitmap yourself. Add scroll bars to an existing control or perhaps
to the window itself, capture the scroll messages and update the image
accordingly.


Re: Image+ScrollBars by grubbymaster

grubbymaster
Tue Jan 16 08:29:17 CST 2007


AB a scris:
> Perhaps there exists a control in MFC, but for Win32...you have to draw
> the bitmap yourself. Add scroll bars to an existing control or perhaps
> to the window itself, capture the scroll messages and update the image
> accordingly.

Thanks AB. That's how i've done it after searching for a simpler way.
Here is a short code example in case anyone else has this problem in
the future:

case WM_VSCROLL:
{
int nScrollCode = (int)LOWORD(wParam);
int nPos = (short int)HIWORD(wParam);

if (bAM == false)
{
nVPosition = nPos;
InvalidateRect(hWnd, NULL, false);
}

bAM = false;

switch (nScrollCode)
{
case SB_THUMBPOSITION:
{
sVPos = HIWORD (wParam);
SetScrollPos(hWnd, SB_VERT, sVPos, TRUE);

nThumbVPosition = sVPos;
bAM = true;
InvalidateRect(hWnd, NULL, false);
}
break;
}
}
break;