资源简介
将二维数组传递给本函数,本函数会将数组显示为图像。注意数组传递前需先转换为char型。
图像显示是windows编程的基础,本程序可作为一个子函数用于调用,可同时显示多张图像。

代码片段和文件信息
// present.cpp : Defines the entry point for the application.
//
#include “stdafx.h“
#include “present.h“
#include “presentation.h“
// Global Variables:
HINSTANCE hInst;
TCHAR lptitle[] = L“示例图像“;
unsigned char lpImg[280 * 280];
unsigned char lpMaskImg[280 * 280];
// Message handler for about box.
INT_PTR CALLBACK About(HWND hDlg UINT message WPARAM wParam LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
HWND hwnd;
switch (message)
{
case WM_INITDIALOG:
InitImageShow(hInst hDlg NULL);
//SetWindowText (hDlg TEXT (“Dialog Box Caption“)) ;
return (INT_PTR)TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
EndDialog(hDlg LOWORD(wParam));
EndImageShow();
break;
case IDC_LOAD_DATA:
MessageBox(hDlg L“你击了加载数据“ L“提示“MB_OK);
// 注意: 下面调用函数显示图像,着这里将图像数组的指针传递给lpImg即可!!
// 想要显示图像,调用 OpenImageDisplay(hInstlptitle
// imagePtr NULL 200 200 3 NULL NULL);即可
// 各参数说明见present函数。
hwnd = OpenImageDisplay(hInst lptitle
lpImg NULL 280 280 3 NULL NULL);
break;
case IDC_START_RECON:
MessageBox(hDlg L“你击了开始重建“ L“提示“MB_OK);
// 注意: 下面调用函数显示图像,着这里将图像数组的指针传递给lpImg即可!!
hwnd = OpenImageDisplay(hInst lptitle
lpImg NULL 280 280 3 NULL NULL);
AddMaskImageShow(hwnd 280 280 lpMaskImg);
break;
}
}
return (INT_PTR)FALSE;
}
int APIENTRY _tWinMain(HINSTANCE hInstance
HINSTANCE hPrevInstance
LPTSTR lpCmdLine
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
int i;
for (i=0; i<280 * 280; i++)
{
lpImg[i] = (i / 280 + i % 280) % 256;
lpMaskImg[i] = 256 - (i / 280 + i % 280) % 256;
}
hInst = hInstance;
return (int) DialogBoxParam(hInst MAKEINTRESOURCE(IDD_ABOUTBOX) NULL About NULL);
//return (int) DialogBoxParam(hInst IDABORT NULL About NULL);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 77824 2011-11-17 14:07 present\Debug\present.exe
文件 830464 2011-11-17 14:07 present\Debug\present.pdb
文件 52608 2011-11-17 14:07 present\present\present.aps
文件 2157 2012-03-14 18:10 present\present\present.cpp
文件 39 2011-11-14 19:38 present\present\present.h
....... 23558 2003-07-23 17:52 present\present\present.ico
文件 4139 2011-11-17 14:07 present\present\present.rc
文件 4997 2011-11-14 20:34 present\present\present.vcproj
文件 1427 2012-03-14 18:10 present\present\present.vcproj.302-BAA34190086.zhanghui.user
文件 1409 2011-11-14 21:19 present\present\present.vcproj.hahaha.doumx.user
文件 31275 2011-11-14 21:03 present\present\presentation.cpp
文件 475 2011-11-14 21:09 present\present\presentation.h
文件 2165 2011-11-14 19:38 present\present\ReadMe.txt
文件 1078 2011-11-17 14:07 present\present\resource.h
文件 23558 2003-07-23 17:52 present\present\small.ico
文件 294 2011-11-14 19:38 present\present\stdafx.cpp
文件 529 2011-11-14 19:38 present\present\stdafx.h
文件 1428 2011-11-14 19:38 present\present\targetver.h
文件 7523328 2012-03-14 18:10 present\present.ncb
文件 887 2011-11-14 19:38 present\present.sln
..A..H. 26624 2012-03-14 18:10 present\present.suo
目录 0 2011-11-17 14:07 present\Debug
目录 0 2012-03-14 18:10 present\present
目录 0 2011-11-14 22:39 present
----------- --------- ---------- ----- ----
8610263 24
相关资源
- Windows异步套接字网络编程
- VC 获得文件属性 获取文件的创建时
- 基于MVC模式的会员管理系统
- silicon lab公司的收音IC SI47XX全套开发工
- 读者写者问题(读者优先,写者优先
- MFC程序-碰撞的小球
- vc 柱形图 CBarChart
- 用vc 写的导线测量,针对刚学测绘的
- 用VC 编写的仿QQ聊天室程序源代码
- 栅栏填充算法源码(VC)
- 简单的房屋租赁系统
- .net网站服装销售系统(MVC)
-
ob
jectARX给Auto CAD加工具条 - blowfish的vc2008工程.rar
- 画图程序MFC/VC/VC CRectTracker 串行化
- capon波束形成算法-VC实现
- 读取串口数据并画实时曲线的VC 程序
- VC 游戏编程—附源代码
- IpHlpApi.h&IpHlpApi.lib
- vc 6.0开发的流程图编辑器
- VC 天空盒(skyBox)实现(附源代码)
- c MFC 画多边形
- keil vcom windows 7 64bit 驱动
- vc URL编解码类
- vc编写中国象棋详细源码注释并附有视
- VC 围棋源代码
- 用VC 编写的基于SNMP的路由器拓扑程序
- vc利用MFC底层开发的二维GIS管理软件,
- 兰勃托地图投影VC源码
- 清华大学郑莉C 语言程序设计课件
评论
共有 条评论