احصل على سياق النافذة "
hDC_Window = GetWindowDC(hWnd_SrcWindow) hDC_Mem = CreateCompatibleDC(hDC_Window)
احصل على قياسات النوافذ "
ScreenWidth = GetDeviceCaps (hDC_Window, HORZRES) ScreenHeight = GetDeviceCaps(hDC_Window, VERTRES)
الحصول على أبعاد المنطقة المطلوب طباعتها "
الفصل السادس
r = GetWindowRect(hWnd_SrcWindow, Rect) Window_Width = Abs(Rect. Right - Rect.Left) Window_Height = Abs(Rect.Bottom - Rect.Top)
عمل سياق متوافق مع سياق النافذة "
hBmp_Window = CreateCompatible Bitmap(hDC_Window, Window_Width,
Window_Height)
hPrevBmp = SelectObject(hDC_Mem, hBmp_Window)
انسخ صورة النافدة إلى السياق الموجود في الذاكرة "
r1 = BitBlt(hDC_Mem, 0, 0, Window_Width, Window_Height, hDC_Window, 0, 0, SRCCOPY)
احصل على أبعاد المنطقة الداخلية "
r = GetClientRect(hWnd_SrcWindow, RectClient) Client_Width = Abs(RectClient.Right - RectClient.Left) Client Height = Abs(RectClient.Bottom - RectClient.Top)
احسب المنطقة الداخلية "
= RectClient.Left
pClient.x =
pClient.y = RectClient.Top
r = ClientToScreen (hWnd_SrcWindow, pClient)
xDiff = Abs(pClient.x - Rect.Left)
yDiff = Abs(pClient.y - Rect.Top)
احصل على سياق للمنطقة الداخلية "
-
hDC_MemClient = CreateCompatibleDC(hDC_Window)
hBmp_Client = CreateCompatibleBitmap(hDC_Window, Client_Width,
Client Height)
hBmpClientPrev = SelectObject(hDC_MemClient, hBmp_Client)
٣٨٦
ص ٤٢٤