我爱Aspx >> Asp.Net >> 上面提到的原代码(C语言)—1}
image->width=max-min+10;
}
void ScaleMyImage(pmyimg image,int neww){
int newh;
int i,j;
int sx,sy,ex,ey;
unsigned char *newd,*p;
unsigned char *l1,*l2;
int sum,c,s,t;
newh=image->height*neww/image->width;
newd=(unsigned char *)malloc(newh*neww);
if(!newd)
Error("memory allocation error in ScaleImage\n");
p=newd;
sy=0;
for(i=0;i<newh;i++){
ey=(i+1)*image->height/newh;
sx=0;
l1=image->data+sy*image->width;
for(j=0;j<neww;j++){
ex=(j+1)*image->width/neww;
sum=0;
c=0;
l2=l1;
for(s=sy;s<ey;s++){
for(t=sx;t<ex;t++){
sum+=l2[t];
c++;
}
l2+=image->width;
}
*p=sum/c;
p++;
sx=ex;
Ҷƪл˵?
Huffman with Short dictionary压..[05-31]
给贝贝的,Base64编码(带有Q和B..[05-31]
C#的BinaryTree实现[05-31]
LinkedQueue的实现[05-31]
将字符串中的数字和字符分离的技..[05-31]
呵呵,泼点儿凉水。[05-31]
密码的故事 (ST:MS,Author:Billy..[05-31]
关于字符窜和数字分离[05-31]
如何获得一个6位长随机数[05-31]
给你一个MD5算法[05-31]