MineField Create a Form 1. Create a new Visual C# Form project called MineField.
ID: 3838840 • Letter: M
Question
MineField
Create a Form 1. Create a new Visual C# Form project called MineField. 2. Create the following form design. 3. The blue squares are labels. They are placed in a TableLayoutPanel. a. Add a TableLayoutPanel to your form. b. Click Edit Rows and Columns. c. Add 3 more columns for a total of 5 columns d. Select all of the columns, and set the Size Type to Percent 20.00. e. Click the drop down menu to choose Rows. f. Add 2 more rows for a total of 4 rows. g. Select all of the rows, and set the Size Type to Percent 25.00. Click OK h. Resize the TableLayoutPanel, taking care to keep the table square. i. Add a label to the first cell. Resize the label to fit. Change the BackColor to Blue. Delete the Text property. j. Copy this label, and paste it into each of the cells from left to right, and then to the next row. k. Leave the label names label1, label2, etc. 4. Add a MenuStrip. a. The File menu has an Exit command. b. The Options menu should have CheckMarks, and Medium should be enabled by default. Right Click the menu item to choose Checked. c. Each menu item connects to the appropriate code which you will be supplied later in this project. 5. The Help menu has an About command which displays directions for the game and information about the author.
this is what it shouldlook like.
please note that it is in C#
Minefield File Options Help Easy: 5 squares to win Medium: 100 squares to win Difficult: 15 squares to win Wina: 0 outExplanation / Answer
open static Bitmap ResizeBitmapOnWhiteCanvas(Bitmap bmpOriginal, Size szTarget, bool Stretch)
{
Bitmap result = new Bitmap(szTarget.Width, szTarget.Height);
utilizing (Graphics g = Graphics.FromImage((Image)result))
{
g.InterpolationMode = InterpolationMode.NearestNeighbor;
g.FillRectangle(Brushes.White, new Rectangle(0, 0, szTarget.Width, szTarget.Height));
on the off chance that (Stretch)
{
g.DrawImage(bmpOriginal, 0, 0, szTarget.Width, szTarget.Height);/fills the square (extend)
}
else
{
glide OriginalAR = bmpOriginal.Width/bmpOriginal.Height;
glide TargetAR = szTarget.Width/szTarget.Height;
on the off chance that (OriginalAR >= TargetAR)
{
/Original is more extensive than target
glide X = 0F;
glide Y = ((float)szTarget.Height/2F) - ((float)szTarget.Width/(float)bmpOriginal.Width * (float)bmpOriginal.Height)/2F;
glide Width = szTarget.Width;
glide Height = (float)szTarget.Width/(float)bmpOriginal.Width * (float)bmpOriginal.Height;
g.DrawImage(bmpOriginal, X, Y, Width, Height);
}
else
{
/Original is smaller than target
glide X = ((float)szTarget.Width/2F) - ((float)szTarget.Height/(float)bmpOriginal.Height * (float)bmpOriginal.Width)/2F;
glide Y = 0F;
glide Width = (float)szTarget.Height/(float)bmpOriginal.Height * (float)bmpOriginal.Width;
glide Height = szTarget.Height;
g.DrawImage(bmpOriginal, X, Y, Width, Height);
}
}
}
return result;
}