StretchBlt приближение
Программа приближает бесконечно, как сделать чтоб приближение было единоразовым?
#include <iostream>
#include "windows.h"
int main()
{
HWND desktop = GetDesktopWindow();
HDC desk = GetDC(NULL);
RECT rect;
GetClientRect(desktop, &rect);
float m_zoomFactor = 2.0;
int w = rect.right - rect.left;
int h = rect.bottom - rect.top;
int x = w / 2;
int y = h / 2;
int zoomWidth = (int)(0.5 + w * m_zoomFactor);
int zoomHeight = (int)(0.5 + h * m_zoomFactor);
double dXFactor = (double)w / x;
double dYFactor = (double)h / y;
int left = x - zoomWidth / dXFactor;
int right = y - zoomHeight / dYFactor;
while (1)
{
SetStretchBltMode(desk, HALFTONE);
StretchBlt(desk, left, right, zoomWidth, zoomHeight, desk, 0, 0, w, h, SRCCOPY);
Sleep(500);
}
return 0;
}