canvas - Use iplRotate the picture what I get is losing the part of left and right .why? -


the code create createimageheader 2 :imageso , imagede, value imagedata scanline , rotate judge angle, value scanline imagedata,

i show main code said behind,hope give me 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;   }    

i know reason , because after rotated, canvas rotating,so set canvas square rectangle before.also understand picture in canvas's position help.

here website introduce details of canvas rotate. enter link description here


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -