【求助】用c语言编辑图片的问题(visual studio2010)
#inlude <stdio.h>
#include <stdlib.h>
#include "bmpio.h"
#pragma comment (lib, "bmpio.lib")
#pragma comment (linker,"/NODEFAULTLIB:libc.lib")int main(void)
{
unsigned char* plmg;
unsigned char*pR, *pG, *pB;
unsigned int width, height;
unsigned int w, h; plmg = bio_bmp2rgbp(&width,&height,"testimage.bmp");
pR = plmg;
pG = plmg + width * height;
pB = plmg +width*height*2;
for( h=100,w=0;w<width;w++)
{
pR[h*height+w]=0;
pG[h*height+w]=255;
pB[h*height+w]=0;
} bio_rgbp2bmp(plmg,width,height,"test2.bmp");
free(plmg);
return 0;
}
1.在生成图片(100,100)的位置上加上大小为(50,50)的黄色正方形。
2.图片的color plane中,把R-plane与B-plane调换
3.把图片变成黑白
我是新手
麻烦大家帮帮忙~~谢谢了~