c 语言实现24位bmp图片加载,读写,放大缩小
原文链接地址:http://hi.baidu.com/erfolgreich/blog/item/ce94dbad02c0c3f7faed5010.html
c 语言实现24位bmp图片加载,读写,放大缩小
可用 microsoft visual c++ 6.0 建立Win32 Console Application 工程,添加如下.cpp
2010-04-30 10:24
发现好多人网上查找c 语言版本的bmp图像读取,保存,放大,缩小程序,很难找到完整的。 现在将自己写的贴出来 供大家学习参考交流。转载请标明出处,尊重作者劳动成果。
/**********************************************************
作者:fankaipeng
时间:2010-04-27
文件名称:zoombmp.cpp
描述:c 语言实现24位bmp图片读写,放大缩小。
开发工具 microsoft visual c++
开发平台 windows
***********************************************************/
#include <windows.h>
#include <stdio.h>
#define FXZOOMRATIO 1.5 //x轴放大倍数
#define FYZOOMRATIO 1.5 //y轴放大倍数
unsigned char *pBmpBuf; //读入图像数据的指针
unsigned char *pNewBmpBuf;
int bmpWidth;//图像的宽
int bmpHeight;//图像的高
相关文档:
没想到 没想到 万万没想到
对C++八窍只通了7窍的我,竟然要开始搞c++了的说,真是好不刺激。
不敢相信,不敢相信。
类型是什么玩意?类怎么写?字符串怎么处理?怎么释放内存?
偶不知,不知,真的不知。。。。
哎 完都完了。
唉 不管怎么说都要去学的。。。一点辙都没有
#incl ......
1.求下面函数的返回值(微软)
int func(x)
{
int countx = 0;
while(x)
{
countx ++;
x = x&(x-1);
......
//为了和DSP兼容,TSint64和TUint64设置成TSint40和TUint40一样的数
//结果VC中还是认为是32位的,显然不合适
//typedef signed long int TSint64;
//typedef unsigned long int TUint64; &nb ......
1.时间表示
在程序当中,我们经常要输出系统当前的时间,比如我们使用date命令的输出结果.这个时候我们可以使用下面两个函数:
#include <sys/time.h>
time_t time(time_t *tloc);
char *ctime(const time_t *clock);
time函数返回从1970年1月1日0 ......