自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 资源 (5)
  • 问答 (1)
  • 收藏
  • 关注

原创 Direct2D死机崩溃现象

开发Windows程序的图形库,有很多选择,Cairo,QT等等,但我比较喜欢用Native图形库:GDI,GDI+,DIRECT2D,GDI感觉逐步退出舞台,因为界面美观的和它沾不边;GDI+是一个大坑,蜗牛般的龟速,如果不构想缓冲层,你根本无法用GDI+来写一个界面程序,否则你的程序绘制帧数很难高于30;而Direct2D看似是GDI和GDI+的终结者,但它也有致命之处:Direc

2017-03-29 18:43:57 2300 1

原创 Direct2D 第6篇 绘制多种风格的线条

上图是使用Direct2D绘制的线条,Direct2D在效率上比GDI/GDI+要快几倍,GDI/GDI+绘图是出了名的“慢”,不过Direct2D的绘制线条代码,要比GDI/GDI+要繁锁一些。1.首先,初始化Direct2D(可以参考 http://blog.csdn.net/ubuntu_ai/article/details/50365536 )2.创建线条的风格实例

2016-01-02 11:18:43 3433

原创 Direct2D 第5篇 绘制图像

我加载的图像是一张透明底PNG图像,背景使用渐变的绿色画刷#include #include #include #include #pragma comment(lib, "dwrite.lib")#pragma comment(lib, "d2d1.lib")#include HINSTANCE g_hinst;HWND g_hwnd;ID2D

2015-12-20 22:08:52 6048 1

原创 Direct2D 第4篇 渐变画刷

#include #include #include #include #pragma comment(lib, "dwrite.lib")#pragma comment(lib, "d2d1.lib")HINSTANCE g_hinst;HWND g_hwnd;ID2D1Factory * g_factory;ID2D1HwndRenderTarget * g_render

2015-12-20 21:32:23 2495 1

原创 Direct2D 第3篇 绘制文字

#include #include #include #include #pragma comment(lib, "dwrite.lib")#pragma comment(lib, "d2d1.lib")HINSTANCE g_hinst;HWND g_hwnd;ID2D1Factory * g_factory;ID2D1HwndRenderTarget * g_render

2015-12-20 21:07:12 2472 1

原创 Direct2D 第2篇 绘制椭圆

#include #include #include #include #pragma comment(lib, "dwrite.lib")#pragma comment(lib, "d2d1.lib")HINSTANCE g_hinst;HWND g_hwnd;ID2D1Factory * g_factory;ID2D1HwndRenderTarget * g_render

2015-12-20 20:46:11 1686

原创 Direct2D 第1篇 最简单的D2D程序

编译之前,得先安装DirectX SDK#include #include #include #include #pragma comment(lib, "dwrite.lib")#pragma comment(lib, "d2d1.lib")HINSTANCE g_hinst;HWND g_hwnd;ID2D1Factory * g_factory

2015-12-20 20:36:24 3018 1

原创 解决无法打atlapp.h头文件的问题 !

如果编译器提示“无法找到atlapp.h头文件”,原因是你的编译器没有WTL(Windows Template Library)。一般情况下,Visual Studio不会默认帮你安装WTL模块,所以需要自行下载这个模块。WTL9.1版本可以到这里下载:http://sourceforge.net/projects/wtl/?source=typ_redirect下

2015-11-21 12:48:17 1890

原创 高期模糊算法-汇编实现

很多前年前用汇编指令“优化”的高斯模糊算法,为了提升速度,我把部分函数需要的数据"固化“了,这些代码不依赖任何高级的图像库,可以直接适当修改然后引用在你的项目中(关于汇编指令,个人想说的,使用汇编优化改写的函数,其速度是否最高效要根据计算机硬件以及编译器的编译优化算法而定)效果图预览:头文件:#pragma once// // 注意 !!! //

2015-11-10 14:21:45 547

原创 非MFC的界面编程 - 复选框CHECKBOX

激活复选框 CHECKBOXSendMessage(GetDlgItem(hDialog, IDC_CHECK1), BM_SETCHECK, BST_CHECKED, 0); 判断复选框CHECKBOX是否处于选中状态 bool flag_checked = ( BST_CHECKED == IsDlgButtonChecked(hDialog, IDC_CHECK1)

2015-11-05 13:27:20 405

转载 VC的剪贴板操作

VC的剪贴板操作1、文本内容的操作2、WMF数据的操作3、位图的操作4、设置使用自定义格式5、感知剪贴板内容的改变6、自动将数据粘贴到另一应用程序窗口一、文本内容的操作下面的代码示范了如何将文本内容复制到剪贴板(Unicode编码的先转化为ASCII):CString source;//文本内容保存在source变量中if( OpenCl

2013-05-29 16:54:47 991

转载 取CPU利用率

#define _WIN32_WINNT 0x0501#include #include using namespace std;__int64 CompareFileTime ( FILETIME time1, FILETIME time2 ){ __int64 a = time1.dwHighDateTime << 32 | time1.dwLowDate

2013-05-02 12:46:15 625

原创 最简单的屏幕截屏

#include #include const int SCREENW = GetSystemMetrics(SM_CXSCREEN);const int SCREENH = GetSystemMetrics(SM_CYSCREEN);int main(){ HWND hdesktopwnd = GetDesktopWindow(); HDC hdesktopdc = GetDC

2013-03-30 22:37:46 799

转载 VC6 鼠标钩子 最简单例子

.Windows系统是建立在事件驱动的机制上的,说穿了就是整个系统都是通过消息的传递来实现的。而钩子是Windows系统中非常重要的系统接口,用它可以截获并处理送给其他应用程序的消息,来完成普通应用程序难以实现的功能。钩子可以监视系统或进程中的各种事件消息,截获发往目标窗口的消息并进行处理。这样,我们就可以在系统中安装自定义的钩子,监视系统中特定事件的发生,完成特定的功能,比如截获

2013-03-30 10:43:03 687

转载 VC设置鼠标形状

消息下:SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));或是:HCURSOR   hc;hc=LoadCursor(NULL,IDC_CROSS);             SetCursor(hc);IDC_APPSTARTING     带小沙漏的标准箭头   IDC_ARROW

2013-03-29 17:29:54 5907

原创 DOS窗口关闭事件

#include #include #include using namespace std;#define KeyDown(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)#define Msg(info) MessageBox(NULL,info,"message",MB_OK) BOOL WINAPI DosWnd

2013-02-03 13:58:10 1197

原创 VC玻璃特效窗口

#include #include #include #define KeyDown(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)#define Msg(info) MessageBox(NULL,info,"message",MB_OK)#define ErrorMsg(info) MessageBox(N

2013-01-18 20:40:32 784

转载 ImageMagick

[转载]ImageMagick 经验帖 (2010-07-08 17:16:55)原文地址:经验帖" style="text-decoration:initial; color:rgb(206,53,53)">ImageMagick 经验帖作者:paper0023/*****************************************

2013-01-16 00:05:25 1229

转载 C++ 中隐藏DOS调用的命令行窗口

C++ 中隐藏DOS调用的命令行窗口原文地址:http://hi.baidu.com/kalcaddle/item/cb83d70f720d27e6f45ba689      我演示了一下在MFC程序中怎么应用DOS的dir的命令,可是我们遇到了需要解决的问题,首先就是文件dir.txt的残留问题,其实这个问题很简单,我们也可以用dos的del命令在操作

2013-01-12 09:47:13 1174

原创 最简单的操作系统

运行于虚拟机汇编风格:NASMorg 0x7c00jmp begin_real_modeboot_msg:db "Load boot..."pm_msg:db "go to protected mode..." printmsg:mov ax,0x1301; Service numbermov dx,0

2013-01-01 19:14:17 410

原创 汇编练习-3

虚拟机上运行的汇编org 07c00hbuf: db "000011111",0start:mov ax,csmov ds,axmov es,axmov ss,axmov sp,8000hmov di,bufmov ax,1246hcall print_hexmov

2013-01-01 19:11:33 355

原创 指针的控制范围

#include using namespace std;void main(){ int a[3][4]={ {1,2,3,4}, {5,6,7,8}, {9,10,11,12} }; int **p=(int**)&a; // p的作用不等效于a,所以无法对p这样引用 p[?][?] cout<<"a: "<<a<<endl; cout<<"a[0]: "<<a[0]<

2013-01-01 19:07:50 500

翻译 3D编程-Texture

#include #include #include #pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9.lib")#pragma comment(lib,"winmm.lib")#define KeyDown(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0

2012-12-27 14:08:25 575

原创 C++逗号表达式

你的宝刀磨好了吗?#define ADD_BOUND(var,step,bound) \(int)( ( var+=(step),var>(bound) ) ? ( var=(bound), 1 ) : 0  )

2012-12-22 00:37:28 347

原创 内嵌汇编练习-2

使用汇编实现absf函数,以上汇编代码针对long为32位的计算机编译器是VC系列,曾经不知道为什么absf这个函数执行效率异常缓慢,所以用汇编写了这段代码,在SSE指令集中,有一条指令可以完全代替以上的代码...// #define iam_float_to_int32 iam_fstoi32#define iam_fstoi32\_asm push ecx\_asm

2012-12-21 22:33:04 330

原创 图像旋转+二线性插值算法

long BilinearInterpolateD( const SwImage & pic,double fx,double fy ){ #define BILINEAR4_UNITRPOC(a,b,c,d) ((a<<22) +(b-a)*rx2048 + (c-a)*ry2048 + (a-b-c+d)*rxry ) long x = (long)fx; long y = (

2012-12-21 18:44:09 891

翻译 3D编程-旋转的立方形

#include #include #include #pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9.lib")#pragma comment(lib,"winmm.lib")#define KeyDown(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0

2012-12-21 16:31:37 603

翻译 3D编程-绘制任意多边形

#include #include #include #pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9.lib")#pragma comment(lib,"winmm.lib")#define KeyDown(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0

2012-12-21 12:46:04 567

原创 函数自动调用

//=========== Visual C++ version ===============#include int foo1(){ printf("%s\n", __FUNCTION__); return 0;}int foo2(){ printf("%s\n", __FUNCTION__); return 0;}int foo3(){ printf("%s\

2012-12-19 12:36:10 355

翻译 3D编程-旋转的三角形

#include #include #include #pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9.lib")#pragma comment(lib,"winmm.lib")#define KeyDown(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0

2012-12-18 23:10:25 392

翻译 3D编程-绘制最简单的三角形

#include #include #include #pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9.lib")#pragma comment(lib,"winmm.lib")#define KeyDown(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0

2012-12-18 22:57:14 606

原创 内嵌汇编练习-1

//compiler: visual c++//system: win7#include  #define pureasmcall(retval)\__declspec(naked) retval _stdcall// desc: directly return npureasmcall(int) getparam(int){__asm{pu

2012-12-15 01:46:31 376

原创 dangerous fork !

System: UbuntuCompiler: gcc使用fork创建一个子进程的时候,如果一不心可能出现很难找到的BUG,特别是子进程修改父进程的数据的时候.....下面是一个例子,在父进程打开了一个文件,理论上的"子进程会把父进程的数据拷贝到自己的数据区"是正确的,但open所打开的文件的数据在系统内存中,而不是在父进程的数据区中! 所以造成的后果就是子进程把文件内部指针位置

2012-05-19 00:14:42 324

Direct2D绘制多种风格的线条

使用Direct2D高效(比GDI,GDI+快几倍)绘制多种风格的线条,作者使用VS2012编译,压缩包内仅包含一个cpp文件,所以方便转换到其他VisualStudio版本.zip

2016-01-02

WTL91 (Window Template Library)

如果编译器提示找到atlapp.h头文件,你可以下载这个压缩包,解压其到某个目录,并在编译中设置头文件包含目录便可。

2015-11-21

VS2008配置GTK

详解说明WINDOW7系统下VS2008如何安装GTK,内有GTK的安装文件,无需再下载任何文件,并在文档中附有GTK的源码示例

2013-07-04

reader(first version)

a reader for computer that you can download and rewrite it if you want, send e-mail to me if you have any questions about this source...

2012-12-11

GTK+2.0图形界面编程示例

this tutorial supports some instances about gtk+ graphics interface programming.

2012-06-19

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除