文件名称:05
- 所属分类:
- 界面编程
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 6.31mb
- 下载次数:
- 0次
- 提 供 者:
- sun***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
一个基于MFC的简单的屏幕截图工具,其中实现了热键截取-DWORD size=bitmap.bmWidthBytes*bitmap.bmHeight //图片数据大小
LPSTR lpData=(LPSTR)GlobalAlloc(GPTR,size)
int panelsize = 0 //记录调色板大小
if(bitmap.bmBitsPixel<16) //判断是否为真彩色位图
panelsize =(int)pow(2,bitmap.bmBitsPixel*sizeof(RGBQUAD))
BITMAPINFOHEADER*pBInfo = (BITMAPINFOHEADER*)LocalAlloc(LPTR,
sizeof(BITMAPINFO)+panelsize) //位图头指针
pBInfo->biBitCount = bitmap.bmBitsPixel //位图像素
pBInfo->biClrImportant = 0
pBInfo->biCompression = 0
pBInfo->biHeight = bitmap.bmHeight //位图高
pBInfo->biPlanes = bitmap.bmPlanes
pBInfo->biSize = sizeof(BITMAPINFO)
pBInfo->biSizeImage = bitmap.bmWidthBytes*bitmap.bmHeight //数据
pBInfo->biWidth = bitmap.bmWidth //位图宽
pBInfo->biXPelsPerMeter = 0
pBInfo->biYPelsPerMeter = 0
GetDIBits(memDC.m_hDC,bmp,0,pBInfo->biHeight,lpData,
(BITMAPINFO*)pBInfo,DIB_RGB_COLORS)
LPSTR lpData=(LPSTR)GlobalAlloc(GPTR,size)
int panelsize = 0 //记录调色板大小
if(bitmap.bmBitsPixel<16) //判断是否为真彩色位图
panelsize =(int)pow(2,bitmap.bmBitsPixel*sizeof(RGBQUAD))
BITMAPINFOHEADER*pBInfo = (BITMAPINFOHEADER*)LocalAlloc(LPTR,
sizeof(BITMAPINFO)+panelsize) //位图头指针
pBInfo->biBitCount = bitmap.bmBitsPixel //位图像素
pBInfo->biClrImportant = 0
pBInfo->biCompression = 0
pBInfo->biHeight = bitmap.bmHeight //位图高
pBInfo->biPlanes = bitmap.bmPlanes
pBInfo->biSize = sizeof(BITMAPINFO)
pBInfo->biSizeImage = bitmap.bmWidthBytes*bitmap.bmHeight //数据
pBInfo->biWidth = bitmap.bmWidth //位图宽
pBInfo->biXPelsPerMeter = 0
pBInfo->biYPelsPerMeter = 0
GetDIBits(memDC.m_hDC,bmp,0,pBInfo->biHeight,lpData,
(BITMAPINFO*)pBInfo,DIB_RGB_COLORS)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
05
..\GraspBmp
..\........\2011111411m1.bmp
..\........\Debug
..\........\.....\GraspBmp.bsc
..\........\.....\GraspBmp.exe
..\........\.....\GraspBmp.ilk
..\........\.....\GraspBmp.obj
..\........\.....\GraspBmp.pch
..\........\.....\GraspBmp.pdb
..\........\.....\GraspBmp.res
..\........\.....\GraspBmp.sbr
..\........\.....\GraspBmpDlg.obj
..\........\.....\GraspBmpDlg.sbr
..\........\.....\StdAfx.obj
..\........\.....\StdAfx.sbr
..\........\.....\vc60.idb
..\........\.....\vc60.pdb
..\........\GraspBmp.aps
..\........\GraspBmp.clw
..\........\GraspBmp.cpp
..\........\GraspBmp.dsp
..\........\GraspBmp.dsw
..\........\GraspBmp.h
..\........\GraspBmp.opt
..\........\GraspBmp.plg
..\........\GraspBmp.rc
..\........\GraspBmpDlg.cpp
..\........\GraspBmpDlg.h
..\........\ReadMe.txt
..\........\res
..\........\resource.h
..\........\...\GraspBmp.ico
..\........\...\GraspBmp.rc2
..\........\...\保存.bmp
..\........\...\取消.bmp
..\........\...\屏幕截图工具.bmp
..\........\...\选择.bmp
..\........\StdAfx.cpp
..\........\StdAfx.h
..\........\System.ini
..\GraspBmp
..\........\2011111411m1.bmp
..\........\Debug
..\........\.....\GraspBmp.bsc
..\........\.....\GraspBmp.exe
..\........\.....\GraspBmp.ilk
..\........\.....\GraspBmp.obj
..\........\.....\GraspBmp.pch
..\........\.....\GraspBmp.pdb
..\........\.....\GraspBmp.res
..\........\.....\GraspBmp.sbr
..\........\.....\GraspBmpDlg.obj
..\........\.....\GraspBmpDlg.sbr
..\........\.....\StdAfx.obj
..\........\.....\StdAfx.sbr
..\........\.....\vc60.idb
..\........\.....\vc60.pdb
..\........\GraspBmp.aps
..\........\GraspBmp.clw
..\........\GraspBmp.cpp
..\........\GraspBmp.dsp
..\........\GraspBmp.dsw
..\........\GraspBmp.h
..\........\GraspBmp.opt
..\........\GraspBmp.plg
..\........\GraspBmp.rc
..\........\GraspBmpDlg.cpp
..\........\GraspBmpDlg.h
..\........\ReadMe.txt
..\........\res
..\........\resource.h
..\........\...\GraspBmp.ico
..\........\...\GraspBmp.rc2
..\........\...\保存.bmp
..\........\...\取消.bmp
..\........\...\屏幕截图工具.bmp
..\........\...\选择.bmp
..\........\StdAfx.cpp
..\........\StdAfx.h
..\........\System.ini