I have this code:
public void rotateRocketImage() { Bitmap b = this.rocketImgOriginal; //create a new empty bitmap to hold rotated image Bitmap tempBitmap = new Bitmap(97,97); //make a graphics object from the empty bitmap Graphics g = Graphics.FromImage(tempBitmap); //move rotation point to center of image //g.TranslateTransform(48, 48); //rotate //g.RotateTransform(this.orient); //move image back //g.TranslateTransform(-48, -48); //draw passed in image onto graphics object g.DrawImage(b,0,0); this.rocketImg = tempBitmap; }
which (with RotateTransform being turned off currently disabled) should just make this.rocketImg equal to this.rocketImg, but somehow it enlarges the image almost twice ... any ideas what might cause it?
Thanks!

edit: here is the drawing code:
private void timer1_Tick(object sender, EventArgs e) { Invalidate(); } protected override void OnPaint(PaintEventArgs e) { var tempRocket = new Bitmap( rocket.rocketImg ); using (var g = Graphics.FromImage(tempRocket)) { e.Graphics.DrawImage(tempRocket, 150, 150); } }
source share