⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bigsmall.cpp

📁 Wince 下的画图软件的源代码,是一款不错的EVC图形编辑软件,可以直接作为PMP的配套软件.
💻 CPP
字号:
##include "stdafx.h"


#include "stdafx.h"
#include "draw.h"
#include"Bigsmall.h"
#include "MainFrm.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Bigsmall

Bigsmall::Bigsmall()
{
}

Bigsmall::~Bigsmall()
{
}


BEGIN_MESSAGE_MAP(Bigsmall, CStatic)
//{{AFX_MSG_MAP(Bigsmall)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Bigsmall message handlers

void Bigsmall::OnPaint() 
{
	CPaintDC pDC(this);  
	GetScreen();
	RECT rc_set_big;  //SM_CXFULLSCREEN  GetSystemMetrics
	int Swidth=GetSystemMetrics(SM_CXFULLSCREEN);
	int Sheight=GetSystemMetrics(SM_CYFULLSCREEN);
	
	rc_set_big.left=m_FirstPoint.x-20;
	rc_set_big.top=m_FirstPoint.y-20;
	rc_set_big.right=m_FirstPoint.x+20;
	rc_set_big.bottom=m_FirstPoint.y+20;
	
	
	if((m_FirstPoint.x-20)<0){rc_set_big.left=0;rc_set_big.right=40;}
	if((m_FirstPoint.y-20)<0){rc_set_big.top=0;rc_set_big.bottom=40;}
	if((m_FirstPoint.x+20)>Swidth){rc_set_big.left=Swidth-40;rc_set_big.right=Swidth;}
	if((m_FirstPoint.y+20)>Sheight){rc_set_big.top=Sheight-40;rc_set_big.bottom=Sheight;}
	
	CPen pen;
	int  Pos_x=106,Pos_y=135;
	CRect rect(Swidth-Pos_x,Sheight-Pos_y,(Swidth-Pos_x)+80,(Sheight-Pos_y)+80);
	
	pen.CreatePen(PS_SOLID,2,RGB(0,0,0));
	
	CPen *pOldPen=pDC.SelectObject(&pen);	 
	pDC.SelectStockObject(NULL_BRUSH);		
	pDC.Rectangle(rect);
	pDC.SelectObject(pOldPen);
	
	CDC *pDCMem = CDC::FromHandle(hMemDC);
	pDC.StretchBlt(Swidth-Pos_x,Sheight-Pos_y,80,80,pDCMem,rc_set_big.left,rc_set_big.top,40,40,SRCCOPY);
	pDC.ReleaseOutputDC();
	pOldPen->DeleteObject();

}






void Bigsmall::GetScreen()
{
	
	HBITMAP   hBitmap,hOldBitmap;
	
	
	int   xScrn,yScrn;
	int   nWidth,nHeight;
	
	xScrn=25;
	yScrn=28;
	
	nWidth=iScreenWidth-xScrn;
	nHeight=iScreenHeight-yScrn;
	
	hScrDC=CreateDC(L"DISPLAY",NULL,NULL,NULL);
	hMemDC=CreateCompatibleDC(hScrDC);
	hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight);              
        hOldBitmap = (HBITMAP)SelectObject(hMemDC,hBitmap);
	
	BitBlt(hMemDC,0,0,nWidth,nHeight,hScrDC,xScrn,yScrn,SRCCOPY);
	
	::DeleteObject(hBitmap);
	::DeleteObject(hOldBitmap);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -