Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 40 of file winproc.c.
Referenced by SettingsWinProc(), and WindowProcedure().
{ int tbPos = 0; int tempZoom = newZoom; long clientRectScrollbox[4]; long clientRectImageArea[4]; int x, y, w, h; GetClientRect(hScrollbox, (LPRECT) &clientRectScrollbox); GetClientRect(hImageArea, (LPRECT) &clientRectImageArea); w = clientRectImageArea[2] * clientRectScrollbox[2] / (clientRectImageArea[2] * newZoom / zoom); h = clientRectImageArea[3] * clientRectScrollbox[3] / (clientRectImageArea[3] * newZoom / zoom); x = max(0, min(clientRectImageArea[2] - w, mouseX - w / 2)) * newZoom / zoom; y = max(0, min(clientRectImageArea[3] - h, mouseY - h / 2)) * newZoom / zoom; zoom = newZoom; ShowWindow(hSelection, SW_HIDE); MoveWindow(hImageArea, 3, 3, imgXRes * zoom / 1000, imgYRes * zoom / 1000, FALSE); InvalidateRect(hScrollbox, NULL, TRUE); InvalidateRect(hImageArea, NULL, FALSE); SendMessage(hScrollbox, WM_HSCROLL, SB_THUMBPOSITION | (x << 16), 0); SendMessage(hScrollbox, WM_VSCROLL, SB_THUMBPOSITION | (y << 16), 0); while (tempZoom > 125) { tbPos++; tempZoom = tempZoom >> 1; } SendMessage(hTrackbarZoom, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) tbPos); }