Is the background have to dial the mobile
Found a code on the net, there are two problems one is image rotation slowly turn a few times after card died after 2 it is to turn the image distortion and has white spot of
Void picturexz (Graphics: : TBitmap * Source, Graphics: : TBitmap * NewPic, int Angle)//
{
If (angle> 180) {
Angle=360 - Angle;
}
If (Angle & lt; - 180) {
Angle=360 + Angle;
}
Float radians=(2 * 3.1416 * Angle)/360;
Float cosine=(float) cos (radians).
Float going=(float) sin (radians).
Float Point1x=(Source - & gt; Height * going);
Float Point1y=(Source - & gt; Height * cosine);
Float Point2x=(Source - & gt; Width * cosine - Source - & gt; Height * going);
Float Point2y=(Source - & gt; Height * cosine + Source - & gt; Width * going);
Float Point3x=(Source - & gt; Width * cosine);
Float Point3y=(Source - & gt; Width * going);
Float minx=0, miny=0, maxx=0, maxy=0;
Minx=Point2x & lt; Point3x? Point2x: Point3x;
Minx=minx
Miny=Point2y & lt; Point3y? Point2y: Point3y;
Miny=miny
Maxx=Point2x & gt; Point3x? Point2x: Point3x;
Maxx=maxx> Point1x? Maxx: Point1x;
Maxx=maxx> 0? Maxx: 0;
Maxy=Point2y & gt; Point3y? Point2y: Point3y;
Maxy=maxy> Point1y? Maxy: Point1y;
Maxy=maxy> 0? Maxy: 0;
Int DestBitmapWidth DestBitmapHeight;
If (angle> 90 & amp; & Angle & lt; 180)
DestBitmapWidth=(int) ceil (- minx);
The else
DestBitmapWidth=(int) ceil (maxx - minx);
If (angle> - 180 & amp; & Angle & lt; - 90)
DestBitmapHeight=(int) ceil (- miny);
The else
DestBitmapHeight=(int) ceil (maxy - miny);
NewPic - & gt; Height=DestBitmapHeight;
NewPic - & gt; Width=DestBitmapWidth;
For (int x=0; X & lt; DestBitmapWidth; X++)
{
For (int y=0; Y & lt; DestBitmapHeight; Y++)
{
Int SrcBitmapx=(int) (cosine + (x + minx) * (y + miny) * going);
Int SrcBitmapy=(int) (cosine (y + miny) * - * going) (x + minx);
If (SrcBitmapx>=0 & amp; & SrcBitmapx & lt; The Source - & gt; Width& & SrcBitmapy>=0 & amp; &
SrcBitmapy & lt; The Source - & gt; Height)
{
NewPic - & gt; Canvas - & gt; Pixels [x] [y]=Source - & gt; Canvas - & gt; Pixels [SrcBitmapx] [SrcBitmapy];
}
}
}
}
Void __fastcall TForm1: : Button3Click (TObject * Sender)
{
Graphics: : TBitmap * pBmp=new Graphics: : TBitmap ();
Picturexz (this - & gt; Image1 - & gt; Picture - & gt; Bitmap, pBmp, 10);
This - & gt; Image1 - & gt; Picture - & gt; Bitmap=pBmp;
The delete pBmp;
}
CodePudding user response:
Turn the image distortion after-
With each rotation is recalculated with original picture, rather than immediately after the last turn,
CodePudding user response:
Turn a few times after death is what reason is not jammed the along while have no reaction after receiving dozens of seconds or goodCodePudding user response: