资源简介
计算机图形学实验代码(包括图形旋转、图形平移、图形缩放) 内含C++源代码和测试图片

代码片段和文件信息
// 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 36 2004-06-29 23:43 图形学实验\图像平移\readme.txt
文件 36 2004-06-29 23:43 图形学实验\图像平移\图像平移\readme.txt
文件 66614 2009-12-09 12:37 图形学实验\图像平移\图像平移\测试图片\原始lena图像.bmp
文件 66614 2004-06-29 23:42 图形学实验\图像平移\图像平移\测试图片\向上移.bmp
文件 66614 2004-06-29 23:42 图形学实验\图像平移\图像平移\测试图片\向下移.bmp
文件 66614 2004-06-29 23:41 图形学实验\图像平移\图像平移\测试图片\向右移.bmp
文件 66614 2004-06-29 23:39 图形学实验\图像平移\图像平移\测试图片\向左移.bmp
文件 18876 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\dibapi.obj
文件 11611 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\dibapi.sbr
文件 20247 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MainFrm.obj
文件 3682 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MainFrm.sbr
文件 6042 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\mydib.obj
文件 1901 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\mydib.sbr
文件 139360 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIP.exe
文件 350388 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIP.ilk
文件 23130 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIP.obj
文件 361472 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIP.pdb
文件 9372 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIP.res
文件 6886 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIP.sbr
文件 24877 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIPDoc.obj
文件 4664 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIPDoc.sbr
文件 30904 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIPView.obj
文件 8720 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\MyDIPView.sbr
文件 105962 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\StdAfx.obj
文件 1376098 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\StdAfx.sbr
文件 214016 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\vc60.idb
文件 364544 2009-12-09 12:37 图形学实验\图像平移\图像平移\源代码\Debug\vc60.pdb
文件 23782 2004-03-07 17:05 图形学实验\图像平移\图像平移\源代码\dibapi.cpp
文件 1876 2000-02-03 07:29 图形学实验\图像平移\图像平移\源代码\dibapi.h
文件 2506 2004-05-20 14:25 图形学实验\图像平移\图像平移\源代码\MainFrm.cpp
............此处省略218个文件信息
相关资源
- 基于STM32F103ZET6控制舵机旋转(ts90a/
- 交互式计算机图形学 第六版 OpenGL源代
- 图形学简单绘图系统
- OpenGL迷宫山东大学图形学实验三
- 计算机图形学走样反走样时钟
- MFC实现简易画图程序
- c++QT5图形学-中点画圆完整工程文件
- MFC 单文档 实现opengl 三维旋转 缩放
- 西北工业大学软件学院计算机图形学
- 计算机图形学实验源代码中南民族大
- MFC绘制的移动小车,包含了图形的平
- 24位BMP图像用C++实现平移、旋转、镜像
- 图形学各种曲线--Bezier曲线,B-样条曲
- 鼠标交互画圆及椭圆基于Bresenham、中
- 绘制任意斜率的直线段
- MFC 图像处理之几何运算 图像平移旋转
- QSplat:基于点绘制的图形学开山之作
- 计算机图形学简单CAD系统
- 真实感图形学
- 计算机图形学多边形种子填充算法
- 计算机图形学 消隐
- 图像按任意角度旋转C++
- 计算机图形学作业,中点算法画椭圆
- MFC中点圆的生成算法
- 改进的有效边表算法--计算机图形学
- 最好的CS游戏opengl、C++实现
- 梁友栋-直线裁剪算法图形学mfc
- C语言实现图像的旋转缩放裁切
- 计算机图形学 清华大学教材 及 vc++
- VC C++数字图像处理实验程序
评论
共有 条评论