How to Draw and Scale an XNA Sprite to Fit the Entire Screen of an iOS MonoGame Project

This example may be a little bit overboard for most intents and purposes, but this example shows you how you can draw a sprite such that it gets scaled to exactly fit the entire screen of the device you are using for simulation. I tested this using Xamarin Studio 5.9.1 and the latest MonoGame NuGet package available for iOS at the time.

void DrawToFitScreen(Texture2D texture)
{
	var destinationRectangle = new Rectangle (0, 0, GraphicsDevice.PresentationParameters.Bounds.Width, GraphicsDevice.PresentationParameters.Bounds.Height);
	var scale = new Vector2(texture.Width >= GraphicsDevice.PresentationParameters.Bounds.Width ? (float)GraphicsDevice.PresentationParameters.Bounds.Width / texture.Width : (float)texture.Width / GraphicsDevice.PresentationParameters.Bounds.Width,
		texture.Height >= GraphicsDevice.PresentationParameters.Bounds.Height ? (float)GraphicsDevice.PresentationParameters.Bounds.Height / texture.Height : (float)texture.Height / GraphicsDevice.PresentationParameters.Bounds.Height); 
	spriteBatch.Draw(texture, 
		null, 
		destinationRectangle,
		texture.Bounds,
		Vector2.Zero, 
		0, 
		scale,
		Color.White,
		SpriteEffects.None, 
		0);
}

It can easily be called within the Draw method:

spriteBatch.Begin();
DrawToFitScreen(someTexture);
spriteBatch.End();