the code is create CreateImageHeader for two :imageSo and imageDe, then value imagedata by scanline , then rotate by judge angle, then value scanline by imagedata,
I show the main code like what I said as behind,hope someone could give me the suggestion or thinking.
create:
imageSo = CreateImageHeader(bmp->PixelFormat, bmp->Width,bmp->Height);
imageDe = CreateImageHeader(bmp->PixelFormat, bmp->Width,bmp->Height);
shift:
bit1=(BYTE*) bmp->ScanLine[hSrc-1];
bit2=imageSo->imageData;
for(int i=0;i < hSrc;i++)
{
memcpy(bit2,bit1,cpy);
bit1+=wBmp;
bit2+=wIpl;
}
rotate:
if(param.Angle){
double xshift=0;
double yshift=0;
iiplGetRotateShift(bmp->Width/2,bmp->Height/2,BmpProperty.Angle,&xshift,&yshift);
iiplRotate(imageSo,imageDe,BmpProperty.Angle,xshift,yshift,IPL_INTER_CUBIC|IPL_SMOOTH_EDGE);
}
shift2:
bit1=(BYTE*) bmp->ScanLine[hSrc-1];
bit2=imageSo->imageData;
for(int i=0;i < hSrc;i++)
{
memcpy(bit1,bit2,cpy);
bit1+=wBmp;
bit2+=wIpl;
}