• λ我爱Aspx >> Asp.Net >> 上面提到的原代码(C语言)—1
  • 上面提到的原代码(C语言)—1

  • :aspxer  Դ:internet  :2007-5-31 2:20:14  ؼ:
  • }

    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;

    Ҷƪл˵?
  • һƪ上面提到的原代码(C语言)—2
    һƪHuffman with Short dictionary压缩算法(VB.NET Source)