资源简介
VC6.0基于MFC编写的hough变换检测直线的源代码,里面带有图片,可编译运行。可以借鉴,参考。
代码片段和文件信息
// dibapi.cpp
//
// Source file for Device-Independent Bitmap (DIB) API. Provides
// the following functions:
//
// PaintDIB() - Painting routine for a DIB
// CreateDIBPalette() - Creates a palette from a DIB
// FindDIBBits() - Returns a pointer to the DIB bits
// DIBWidth() - Gets the width of the DIB
// DIBHeight() - Gets the height of the DIB
// PaletteSize() - Gets the size required to store the DIB‘s palette
// DIBNumColors() - Calculates the number of colors
// in the DIB‘s color table
// CopyHandle() - Makes a copy of the given global memory block
//
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1997 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include “stdafx.h“
#include “dibapi.h“
#include
#include
#include
#define DIB_HEADER_MARKER ((WORD) (‘M‘ << 8) | ‘B‘)
#ifdef _MAC
#define SWAPWORD(x) MAKEWORD(HIBYTE(x) LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)) SWAPWORD(LOWORD(x)))
void ByteSwapHeader(BITMAPFILEHEADER* bmiHeader);
void ByteSwapInfo(LPSTR lpHeader BOOL fWin30Header);
#endif
/*************************************************************************
*
* PaintDIB()
*
* Parameters:
*
* HDC hDC - DC to do output to
*
* LPRECT lpDCRect - rectangle on DC to do output to
*
* HDIB hDIB - handle to global memory with a DIB spec
* in it followed by the DIB bits
*
* LPRECT lpDIBRect - rectangle of DIB to output into lpDCRect
*
* CPalette* pPal - pointer to CPalette containing DIB‘s palette
*
* Return Value:
*
* BOOL - TRUE if DIB was drawn FALSE otherwise
*
* Description:
* Painting routine for a DIB. Calls StretchDIBits() or
* SetDIBitsToDevice() to paint the DIB. The DIB is
* output to the specified DC at the coordinates given
* in lpDCRect. The area of the DIB to be output is
* given by lpDIBRect.
*
************************************************************************/
BOOL WINAPI PaintDIB(HDC hDC
LPRECT lpDCRect
HDIB hDIB
LPRECT lpDIBRect
CPalette* pPal)
{
LPSTR lpDIBHdr; // Pointer to BITMAPINFOHEADER
LPSTR lpDIBBits; // Pointer to DIB bits
BOOL bSuccess=FALSE; // Success/fail flag
HPALETTE hPal=NULL; // Our DIB‘s palette
HPALETTE hOldPal=NULL; // Previous palette
/* Check for valid DIB handle */
if (hDIB == NULL)
return FALSE;
/* Lock down the DIB and get a pointer to the beginning of the bit
* buffer
*/
l
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 143504 2008-09-10 22:42 源代码\Debug\MyDIP.exe
文件 23782 2004-03-07 17:05 源代码\dibapi.cpp
文件 1876 2000-02-03 07:29 源代码\dibapi.h
文件 2506 2004-05-20 14:25 源代码\MainFrm.cpp
文件 1581 2004-05-20 14:25 源代码\MainFrm.h
文件 3157 2004-05-20 17:49 源代码\mydib.cpp
文件 72 2004-05-20 17:26 源代码\mydib.h
文件 31288 2008-09-10 22:42 源代码\MyDIP.aps
文件 2615 2008-09-10 22:42 源代码\MyDIP.clw
文件 4158 2004-05-20 14:25 源代码\MyDIP.cpp
文件 4781 2004-05-20 17:54 源代码\MyDIP.dsp
文件 533 2004-05-20 14:25 源代码\MyDIP.dsw
文件 1345 2004-05-20 14:25 源代码\MyDIP.h
文件 164864 2008-09-10 22:43 源代码\MyDIP.ncb
文件 49664 2008-09-10 22:43 源代码\MyDIP.opt
文件 2731 2008-09-10 22:42 源代码\MyDIP.plg
文件 352 2008-09-10 21:26 源代码\MyDIP.positions
文件 12279 2008-09-10 20:39 源代码\MyDIP.rc
文件 4007 2004-05-20 17:10 源代码\MyDIPDoc.cpp
文件 1830 2004-05-20 15:17 源代码\MyDIPDoc.h
文件 10056 2008-09-10 21:26 源代码\MyDIPView.cpp
文件 1948 2008-09-10 21:26 源代码\MyDIPView.h
文件 4287 2004-05-20 14:25 源代码\ReadMe.txt
文件 1078 2004-05-20 14:25 源代码\res\MyDIP.ico
文件 397 2004-05-20 14:25 源代码\res\MyDIP.rc2
文件 1078 2004-05-20 14:25 源代码\res\MyDIPDoc.ico
文件 1078 2004-05-20 14:25 源代码\res\Toolbar.bmp
文件 827 2004-06-29 22:54 源代码\Resource.h
文件 207 2004-05-20 14:25 源代码\StdAfx.cpp
文件 1040 2004-05-20 17:21 源代码\StdAfx.h
............此处省略10个文件信息
相关资源
- VC++ 多线程文件读写操作
- 移木块游戏,可以自编自玩,vc6.0编写
- VC++MFC小游戏实例教程(实例)+MFC类库
- VC++实现CMD命令执行与获得返回信息
- VC++基于OpenGL模拟的一个3维空间模型
- mfc绘图大全(画直线、矩形、椭圆)
- 基于VC++的SolidWorks二次开发SolidWorks
- 派克变换VC++源码(附文档)
- VC++ 串口
- VC++ 大富翁4_大富翁游戏源码
- VC++ 摄像头视频采集与回放源程序
- 转 VC++ 实现电子邮件(Email)发送
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- VC++ 服务程序编写及安装与卸载
- VC++6.0番茄西红柿VAXvirsual assist X完美破
- 基于改进的fcm算法的图像分割vc++
- VC++6.0 绿色版,免安装,非常好用。
- Microsoft Visual C++ 2005 Redistributable Pack
- VC++MFC课程设计的学生成绩管理系统
- 大智慧365DLL插件设计
- VC++6.0汉化包
- VC++完整商业界面源码(再上传)
- VC++编程技术600个大型项目源码.rar
- VC++实现RSA加密算法
- VC++ 中国象棋经典游戏源代码
- 郁金香VC++游戏辅助视频教程
- C语言进阶源码---基于graphics实现图书
- 摄影测量相对定向VC++程序
- VC++数字图像处理典型算法及实现
- VC++酒店客房管理系统 MFC
评论
共有 条评论