From b354c153b0074e5d54371bc05b12edbe8e613a19 Mon Sep 17 00:00:00 2001
From: LYW <leeyeanwoo@diteam.co.kr>
Date: 월, 09 8월 2021 10:50:06 +0900
Subject: [PATCH] Ongoing50 #3561 CF AOI Review Align 카메라 끊김 현상 조치

---
 ReviewHistory/include/akGraph/akMemDC.h |   90 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/ReviewHistory/include/akGraph/akMemDC.h b/ReviewHistory/include/akGraph/akMemDC.h
new file mode 100644
index 0000000..ff23d8e
--- /dev/null
+++ b/ReviewHistory/include/akGraph/akMemDC.h
@@ -0,0 +1,90 @@
+
+#pragma once
+
+
+class CakMemDC : public CDC
+{
+public:
+
+	CakMemDC(CDC* pDC, CRect rectDC) : CDC()
+	{
+		ASSERT(pDC != NULL);
+
+		m_pDC = pDC;
+		m_pOldBitmap = NULL;
+		m_bMemDC = false;
+		m_hDC = NULL;
+		if(pDC == NULL)
+		{
+			CreateCompatibleDC(pDC);
+			return;
+		}
+
+#ifndef WCE_NO_PRINTING
+		m_bMemDC = !pDC->IsPrinting();
+#else
+		m_bMemDC = FALSE;
+#endif
+
+		if (m_bMemDC)    
+		{
+			//pDC->GetClipBox(&m_rect);
+			m_rect = rectDC;
+			CreateCompatibleDC(pDC);
+			m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height());
+			m_pOldBitmap = SelectObject(&m_bitmap);
+#ifndef _WIN32_WCE
+			//SetWindowOrg(m_rect.left, m_rect.top);
+			SetWindowOrg(0,0);
+#endif
+			FillSolidRect(m_rect, pDC->GetBkColor());
+		}
+		else   
+		{
+#ifndef WCE_NO_PRINTING
+			m_bPrinting = pDC->m_bPrinting;
+#endif
+			m_hDC       = pDC->m_hDC;
+			m_hAttribDC = pDC->m_hAttribDC;
+		}
+
+	}
+
+	virtual ~CakMemDC()
+	{
+		if (m_bMemDC)
+		{
+			m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.right, m_rect.bottom,
+				this, m_rect.left, m_rect.top, SRCCOPY);
+			
+
+			SelectObject(m_pOldBitmap);
+			//DeleteDC(); 
+			//m_bitmap.DeleteObject();
+			
+		}
+		else
+		{
+			m_hDC = m_hAttribDC = NULL;
+		}
+	}
+
+	CakMemDC* operator->()
+	{
+		return this;
+	}
+
+	operator CakMemDC*()
+	{
+		return this;
+	}
+
+private:
+	CBitmap  m_bitmap;      // Offscreen bitmap
+	CBitmap* m_pOldBitmap;  // bitmap originally found in CakMemDC
+	CDC*     m_pDC;         // Saves CDC passed in constructor
+	BOOL     m_bMemDC;      // TRUE if CDC really is a Memory DC.
+public:
+	CRect    m_rect;        // Rectangle of drawing area.
+}
+;

--
Gitblit v1.9.3