这几天在看老大写的博客(http://blog.csdn.net/norains ,八卦一下我老大在CSDN上小有名气已经成为了专家), 虽然跟着老大一年多了学到不少的东西但是发现自己要学的东西还有很多很多,我知道“冰冻三尺非一日之寒”,我也相信每个人都是从菜鸟开始做起,最后才能成为大师的。

好了,不说那么废话了。下面是我转载的一段关于在WINCE下截屏的一段实现代码:

void OnScreenSave(const char *filename) { HDC hScrDC, hMemDC; int width, height; //the pointer will save all pixel point's color value BYTE *lpBitmapBits = NULL; //creates a device context for the screen device hScrDC = CreateDC(_T("DISPLAY"), NULL, NULL, NULL); //get the screen point size width = GetDeviceCaps(hScrDC, HORZRES); height = GetDeviceCaps(hScrDC, VERTRES); //creates a memory device context (DC) compatible with the screen device(hScrDC) hMemDC = CreateCompatibleDC(hScrDC); //initialise the struct BITMAPINFO for the bimap infomation, //in order to use the function CreateDIBSection //on wince os, each pixel stored by 24 bits(biBitCount=24) //and no compressing(biCompression=0) BITMAPINFO RGB24BitsBITMAPINFO; ZeroMemory(&RGB24BitsBITMAPINFO, sizeof(BITMAPINFO)); RGB24BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); RGB24BitsBITMAPINFO.bmiHeader.biWidth = width; RGB24BitsBITMAPINFO.bmiHeader.biHeight = height; RGB24BitsBITMAPINFO.bmiHeader.biPlanes = 1; RGB24BitsBITMAPINFO.bmiHeader.biBitCount = 24; //use the function CreateDIBSection and SelectObject //in order to get the bimap pointer : lpBitmapBits HBITMAP directBmp = CreateDIBSection(hMemDC, (BITMAPINFO*)&RGB24BitsBITMAPINFO, DIB_RGB_COLORS, (void **)&lpBitmapBits, NULL, 0); HGDIOBJ previousObject = SelectObject(hMemDC, directBmp); // copy the screen dc to the memory dc BitBlt(hMemDC, 0, 0, width, height, hScrDC, 0, 0, SRCCOPY); //if you only want to get the every pixel color value, //you can begin here and the following part of this function will be unuseful; //the following part is in order to write file; //bimap file header in order to write bmp file BITMAPFILEHEADER bmBITMAPFILEHEADER; ZeroMemory(&bmBITMAPFILEHEADER, sizeof(BITMAPFILEHEADER)); bmBITMAPFILEHEADER.bfType = 0x4d42; //bmp bmBITMAPFILEHEADER.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); bmBITMAPFILEHEADER.bfSize = bmBITMAPFILEHEADER.bfOffBits + ((width*height)*3); ///3=(24 / 8) //write into file FILE *mStream = NULL; if((mStream = fopen(filename, "wb"))) { //write bitmap file header fwrite(&bmBITMAPFILEHEADER, sizeof(BITMAPFILEHEADER), 1, mStream); //write bitmap info fwrite(&(RGB24BitsBITMAPINFO.bmiHeader), sizeof(BITMAPINFOHEADER), 1, mStream); //write bitmap pixels data fwrite(lpBitmapBits, 3*width*height, 1, mStream); //close file fclose(mStream); } //delete DeleteObject(hMemDC); DeleteObject(hScrDC); DeleteObject(directBmp); DeleteObject(previousObject); }

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { const char filename[] = "//nand//screen.bmp"; OnScreenSave(filename); return 0; }

实现代码原帖地址:http://blog.csdn.net/norains/archive/2006/04/29/697108.aspx

EVC实现WIN CE下截屏相关推荐

  1. 实现WIN CE下截屏并且保存到文件

    本文为转载,原文地址丢失,sorry ################################################################################# ...

  2. w ndows默认截图工具,浅谈Win10系统下截屏方式

    前言 虽然近年来Windows式微的言论从不间断,微软也不再将Windows系统作为核心业务而是转向"AI为先·云为先"的战略,但Windows依然占据着全球88.5%的电脑桌面, ...

  3. 服务器双系统快捷键,Mac/Win7双系统下截屏快捷键介绍

    由于苹果电脑采用的是mac系统,使用的用户相对较少,不少购买苹果电脑的朋友经常会遇到一些截图困扰,接下来是小编为大家收集的Mac/Win7双系统下截屏快捷键介绍,希望能帮到大家. Mac/Win7双系 ...

  4. 苹果xr如何截屏_iphone敲两下截屏如何操作 苹果手机触控截屏方法【教程步骤】...

    iphone敲两下截屏如何操作?相信小伙伴们一定很好奇,下面小编为大家带来了苹果手机触控截屏方法教程详解,感兴趣的小伙伴赶紧跟着小编一起来看看吧 iphone敲两下截屏怎么设置 轻点两下进行截屏其实是 ...

  5. Windows CE/Moblie截屏工具及实现源码

    Windows CE/Moblie截屏工具及实现源码 [img]http://dl2.iteye.com/upload/attachment/0084/6997/c72941f2-b86e-3683- ...

  6. UEFI开发探索99 – UEFI Shell下截屏工具

    (请保留-> 作者: 罗冰 https://blog.csdn.net/luobing4365) UEFI Shell下截屏工具 1 PrintScreenLogger的代码结构 1)Print ...

  7. Ubuntu系统下截屏快捷键

    Ubuntu系统下截屏快捷键 常用的: fn+print: 全屏截图 ctrl+alt+print:截取当前窗口 参考链接:https://blog.csdn.net/sunshine_lyn/art ...

  8. Linux下截屏方法!

    一.最便捷的方法         1.按下印屏幕键,截取整个桌面:         2.按下Alt+屏幕键,截取当前窗口: 二.命令行截屏         1.import screenshot.jp ...

  9. android模拟器后台截屏,【Android】Android模拟器下截屏及格式转换

    一,模拟器信息 Android 模拟器手机的色深是16bit, 即R/G/B=5/6/5. 故需要一些特殊处理才能获得其屏幕图像. 我们可以adb登录进入Android模拟器,先dump出/dev/f ...

最新文章

  1. python syslog服务器_Python3+syslog使用及相关说明
  2. 【P2766】 最长不下降子序列问题
  3. Linux常用服务部署与优化之NFS篇
  4. c++产生死锁的必要条件?已经如何预防死锁?
  5. 在猜年龄的基础上编写登录、注册方法,并且把猜年龄游戏分函数处理
  6. 【我的Android进阶之旅】Android自定义Lint实践
  7. 公开征集 | 每个人都可以成为 COSCon'21 主论坛的开源明星
  8. 调用支付jsapi缺少参数:total_fee_小程序支付问题怎么解决?
  9. Linux学习:第六章-Linux服务和进程管理
  10. Centos6.7系统环境下使用 yum install 安装mysql-community-5.7.22(史上最简)
  11. WebSocket知识点总结
  12. Windows环境下多线程编程原理与应用读书笔记(8)————信号量及其应用
  13. spring 事务案例--转账
  14. OpenCV_(Based on Sobel Filter to Detect edges) 基于Sobel算子的方向滤波器检查边缘
  15. Exadata 18.1新特性--计算节点升级增强
  16. 【中间件技术】第一部分 概述(1) 软件构件与中间件基本概念
  17. CSDN数据库泄露!那些网站够安全吗?
  18. EasyExcel自定义表头
  19. 【论文分享】小样本图片分类方法:AwGCN:Few-Shot Learning With Attention-Weighted Graph Convolutional Networks
  20. HP DeskJet 2131 喷墨一体打印机打印设置教程

热门文章

  1. layui xm-select用法
  2. c语言15除以2得到8,C语言程序设计100例之(15):除法算式
  3. c语言中的除法求商例题,除法算式求商的方法 教案
  4. 实时语音趣味变声,大叔变声“妙音娘子”Get一下 1
  5. 【Whole Word Mask】中文 bert wwm 预训练代码,预训练你自己的模型
  6. 初学画画速写人物动态写生的技巧有哪些
  7. 如何提高SEO网站域权重
  8. python从键盘输入一个列表计算输出元素的平均值_从键盘输入一个列表,计算输出列表元素的平均值。 输入输出示例: 输入 [2,3,5,7] 输出 平均...
  9. 平安好医生遭遇困局:六年亏近47亿元 价值百亿品牌或被舍弃
  10. matlab画三维图和等高线,matlab画三维等高线图