Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
DIBAPI.H
Package: vc图像处理比较全面的程序.rar [view]
Upload User: alisonmail
Upload Date: 2013-02-28
Package Size: 500k
Code Size: 2k
Category:
Picture Viewer
Development Platform:
Visual C++
- // dibapi.h
- #ifndef _INC_DIBAPI
- #define _INC_DIBAPI
- // DIB句柄
- DECLARE_HANDLE(HDIB);
- // DIB常量
- #define PALVERSION 0x300
- /* DIB宏 */
- // 判断是否是Win 3.0的DIB
- #define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
- // 计算矩形区域的宽度
- #define RECTWIDTH(lpRect) ((lpRect)->right - (lpRect)->left)
- // 计算矩形区域的高度
- #define RECTHEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top)
- // 在计算图像大小时,采用公式:biSizeImage = biWidth' × biHeight。
- // 是biWidth',而不是biWidth,这里的biWidth'必须是4的整倍数,表示
- // 大于或等于biWidth的,离4最近的整倍数。WIDTHBYTES就是用来计算
- // biWidth'
- #define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4)
- // PCX文件头结构
- typedef struct{
- BYTE bManufacturer;
- BYTE bVersion;
- BYTE bEncoding;
- BYTE bBpp;
- WORD wLeft;
- WORD wTop;
- WORD wRight;
- WORD wBottom;
- WORD wXResolution;
- WORD wYResolution;
- BYTE bPalette[48];
- BYTE bReserved;
- BYTE bPlanes;
- WORD wLineBytes;
- WORD wPaletteType;
- WORD wSrcWidth;
- WORD wSrcDepth;
- BYTE bFiller[54];
- } PCXHEADER;
- // 函数原型
- BOOL WINAPI PaintDIB (HDC, LPRECT, HDIB, LPRECT, CPalette* pPal);
- BOOL WINAPI CreateDIBPalette(HDIB hDIB, CPalette* cPal);
- LPSTR WINAPI FindDIBBits (LPSTR lpbi);
- DWORD WINAPI DIBWidth (LPSTR lpDIB);
- DWORD WINAPI DIBHeight (LPSTR lpDIB);
- WORD WINAPI PaletteSize (LPSTR lpbi);
- WORD WINAPI DIBNumColors (LPSTR lpbi);
- WORD WINAPI DIBBitCount(LPSTR lpbi);
- HGLOBAL WINAPI CopyHandle (HGLOBAL h);
- BOOL WINAPI SaveDIB (HDIB hDib, CFile& file);
- HDIB WINAPI ReadDIBFile(CFile& file);
- BOOL WINAPI DIBToPCX256(LPSTR lpDIB, CFile& file);
- HDIB WINAPI ReadPCX256(CFile& file);
- #endif //!_INC_DIBAPI