资源简介
在c++下完整MFC下的harris源代码。
代码片段和文件信息
// 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17602 2012-12-27 11:25 harris\Harris Corner\Debug\BuildLog.htm
文件 25166 2012-12-27 11:24 harris\Harris Corner\Debug\dibapi.obj
文件 0 2012-12-27 11:24 harris\Harris Corner\Debug\dibapi.sbr
文件 7228416 2012-12-27 11:25 harris\Harris Corner\Debug\imagetest.bsc
文件 145920 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.exe
文件 920 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.exe.em
文件 984 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.exe.em
文件 861 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.exe.intermediate.manifest
文件 1524176 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.ilk
文件 36127 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.obj
文件 28966912 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.pch
文件 3795968 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.pdb
文件 10668 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.res
文件 0 2012-12-27 11:24 harris\Harris Corner\Debug\imagetest.sbr
文件 61766 2012-12-27 11:24 harris\Harris Corner\Debug\imagetestDoc.obj
文件 0 2012-12-27 11:24 harris\Harris Corner\Debug\imagetestDoc.sbr
文件 38329 2012-12-27 11:24 harris\Harris Corner\Debug\imagetestView.obj
文件 0 2012-12-27 11:24 harris\Harris Corner\Debug\imagetestView.sbr
文件 20354 2012-12-27 11:24 harris\Harris Corner\Debug\Input2.obj
文件 0 2012-12-27 11:24 harris\Harris Corner\Debug\Input2.sbr
文件 34812 2012-12-27 11:24 harris\Harris Corner\Debug\MainFrm.obj
文件 0 2012-12-27 11:24 harris\Harris Corner\Debug\MainFrm.sbr
文件 67 2012-12-27 11:24 harris\Harris Corner\Debug\mt.dep
文件 19557 2012-12-27 11:24 harris\Harris Corner\Debug\ParaInput1.obj
文件 0 2012-12-27 11:24 harris\Harris Corner\Debug\ParaInput1.sbr
文件 466379 2012-12-27 11:24 harris\Harris Corner\Debug\StdAfx.obj
文件 3371339 2012-12-27 11:24 harris\Harris Corner\Debug\StdAfx.sbr
文件 953344 2012-12-27 11:24 harris\Harris Corner\Debug\vc90.idb
文件 2011136 2012-12-27 11:24 harris\Harris Corner\Debug\vc90.pdb
文件 23774 2012-12-27 11:24 harris\Harris Corner\dibapi.cpp
............此处省略40个文件信息
- 上一篇:C++程序设计谭浩强+代码
- 下一篇:C++沉思录_英文版_清晰 带书签目录.pdf
评论
共有 条评论