void CCaptionScreenDlg::Screen(char* filename)
{
HDC hdcSrc = ::GetDC(NULL);
int nBitPerPixel = GetDeviceCaps(hdcSrc, BITSPIXEL);
int nWidth = GetDeviceCaps(hdcSrc, HORZRES);
int nHeight = GetDeviceCaps(hdcSrc, VERTRES);
CImage image;
image.Create(nWidth, nHeight, nBitPerPixel);
BitBlt(image.GetDC(), , , nWidth, nHeight, hdcSrc, , , SRCCOPY);
::ReleaseDC(NULL, hdcSrc);
image.ReleaseDC();
image.Save((LPCTSTR)filename, Gdiplus::ImageFormatPNG);//ImageFormatJPEG
}

VC++ 截屏代码,并保存为想要的格式(BMP,JPG,PNG,GIF等格式)的更多相关文章

  1. ios截屏代码[转]

    http://www.cnblogs.com/chenxiangxi/p/3547974.html 这位博主的连接中将ios自定义大小位置的截屏代码写的很不错,马上就能用的方法,对于只想马上用的程序员 ...

  2. iOS截屏代码

    转载自:http://m.open-open.com/m/code/view/1420469506375 1.普通界面 /** *截图功能 */ -(void)screenShot{ UIGraphi ...

  3. iOS实现截屏 并合适保存

     本文转载至:http://blog.csdn.net/zeng11088/article/details/8664510 分类: UIImageView2013-03-12 16:42 122人阅读 ...

  4. ios摇一摇截屏代码

    #import "ViewController.h" @interface ViewController () @end @implementation ViewControlle ...

  5. 【转】Android 音量键+电源键 截屏代码小结

    http://104zz.iteye.com/blog/1752961 原文地址:http://blog.csdn.net/hk_256/article/details/7306590 ,转载请注明出 ...

  6. QT在windows下实现截屏操作并保存为png图片

    QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId()); QString format = ...

  7. unity中编辑器直接截屏代码

    using UnityEngine; using System.Collections; using System.Windows.Forms; public class screenshots : ...

  8. Activity禁止截屏代码

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);

  9. C#在截屏时将截屏之前需要隐藏的控件也截入

    最近我在项目中遇到一个让我十分头疼的问题,就是我在截屏时也将截屏之前隐藏的控件也截入了. 情况:我在Winform窗体有个截屏功能按钮,实现在调用WPF全屏后截屏,但在截屏WPF界面前将界面里的一个L ...

随机推荐

  1. 线程Thread,有参数和参数

    一.不带参数的 using System; using System.Collections.Generic; using System.Text; using System.Threading; n ...

  2. 利用SQL 建立和删除 LINKED SERVER

    USE IS21_xxx; if object_id('tempdb..#tmp') is not null drop table #tmp create table #tmp ( cntr ), i ...

  3. hadoop 完全分布式 下 datanode无法启动解决方法

    问题描述: 在集群模式下更改节点后,启动集群发现 datanode一直启动不起来. 我集群配置:有5个节点,分别为master slave1-5 . 在master以Hadoop用户执行:start- ...

  4. 【HOW】如何通过URL给Reporting Services报表传递参数

    [本地模式Reporting Services] 参见官方文档:http://msdn.microsoft.com/en-us/library/ms154042.aspx 示例:http://serv ...

  5. 【HOW】如何配置SharePoint传入/传出电子邮件设置

    SharePoint 2010的传入和传出邮件配置选项都较简单,但由于需要DNS及Exchange等服务器互相配合,所以要正确配置并不容易. 在微软的官方文档中详细说明了配置步骤:配置传入电子邮件:h ...

  6. IE10中session失效取不到值的问题

    在eworkflow工作流,ebiao报表,eform自定义表单产品升级到IE10的时候,系统登录后,总是会取不到session中的值. for j2ee版本和for dotnet版本都一样取不到值. ...

  7. 关于Jquery中的$.each获取各种返回类型数据的使用方法

    var arr = [ "one", "two", "three", "four"]; $.each(arr, func ...

  8. delphi dev 汉化

    //把以下文件复制到记事本中,并保存为DevChs.ini放在exe的目录下 //有这个cxLocalizer控件 //主窗体创建的时候 if (fileexists(ExtractFilePath( ...

  9. Python体验(09)-图形界面之Pannel和Sizer

    import wx class Form(wx.Frame): def __init__(self,parent,ID,title): wx.Frame.__init__(self,parent,ID ...

  10. iOS 为iPhone和iPad创建不同的storyboard

    复制Main.storyboard,重命名为Main_iPad.storyboard 在info.plist文件中添加 Main storyboard file base name (iPad) -- ...