资源简介
用C++写的图像处理程序,功能非常强大,可实现常见的锐化、平滑、旋转、去噪等功能,还能够实现bmp,jpg,gif,cif等格式的相互转换,并能够显示各种格式的图片,可根据自己需要在添加其他任意的功能。
代码片段和文件信息
// 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-12-03 13:20 Debug\
文件 20477 2012-05-15 17:05 Debug\MainFrm.obj
文件 0 2012-05-15 17:05 Debug\MainFrm.sbr
文件 3941376 2012-05-15 20:25 Debug\MyDIP.bsc
文件 147522 2012-05-15 20:25 Debug\MyDIP.exe
文件 440204 2012-05-15 20:25 Debug\MyDIP.ilk
文件 28193 2012-05-15 17:05 Debug\MyDIP.obj
文件 7007420 2012-05-14 21:54 Debug\MyDIP.pch
文件 500736 2012-05-15 20:25 Debug\MyDIP.pdb
文件 9392 2012-05-15 16:11 Debug\MyDIP.res
文件 0 2012-05-15 17:05 Debug\MyDIP.sbr
文件 24500 2012-05-15 20:25 Debug\MyDIPDoc.obj
文件 0 2012-05-15 20:25 Debug\MyDIPDoc.sbr
文件 61179 2012-05-15 20:13 Debug\MyDIPView.obj
文件 0 2012-05-15 20:13 Debug\MyDIPView.sbr
文件 105658 2012-05-14 21:54 Debug\StdAfx.obj
文件 1375918 2012-05-14 21:54 Debug\StdAfx.sbr
文件 324096 2012-05-01 16:56 Debug\Test.exe
文件 18477 2012-05-14 21:54 Debug\dibapi.obj
文件 0 2012-05-15 16:11 Debug\dibapi.sbr
文件 5738 2012-05-14 21:54 Debug\mydib.obj
文件 1781 2012-05-14 21:54 Debug\mydib.sbr
文件 271360 2012-05-21 20:04 Debug\vc60.idb
文件 405504 2012-05-15 20:25 Debug\vc60.pdb
文件 2496 2012-05-15 17:05 MainFrm.cpp
文件 1470 2012-05-15 17:05 MainFrm.h
文件 31284 2012-05-21 20:04 MyDIP.aps
文件 2844 2012-05-21 20:37 MyDIP.clw
文件 4158 2004-05-20 14:25 MyDIP.cpp
文件 4659 2012-05-15 20:25 MyDIP.dsp
文件 533 2004-05-20 14:25 MyDIP.dsw
............此处省略74个文件信息
相关资源
- VC++远程桌面监控系统
- 山东科技大学C++实训项目 飞机大战
- VC++深入详解(完整版)+所有源代码集
- vc2015c++安装包
- C++程序设计语言特别版题解--详细书签
- C++ GUI Qt 4编程(第二版)(中文高清
- 邓俊辉数据结构第三版c++版.pdf,高清
- 《Microsoft Visual Studio C++ 2010入门经典》
- 能对二值图像进行腐蚀、膨胀、开闭
- c++自学实践项目
- VC++图像处理程序设计PDF + 源码
- Visual C++指纹模式识别系统算法与实现
- VS2010 C++ MFC 登陆界面设计
- VC++2015,32位,64位组件运行库
- 《C++程序设计教程(第二版)》钱能
- 扫雷小游戏 完整源码
- Ply文件读取OpenGL显示
- 白塞尔大地主题解算MFC
- 《Visual C++开发基于SNMP的网络管理软件
- 数据结构与面向对象程序设计(C++版
- Thinking in C++1,2卷
- 教师住房管理系统(C++控制台)
- C++操作word:插入文字、图片、表格,
- C++ GDI+ 实现的画板程序
- 嵌入式系统的微模块化程序设计:实
- Professional C++(第4版)
- Visual C++系统开发精粹-光盘-全部及使
- 深度探索C++对象模型 PDF中文清晰版
- 贪吃蛇大作战demo实现和代码
- qt-eclipse-integration-linux.x86-1.6.1.tar.gz(
评论
共有 条评论