Can center the GIF file in the box. I've tried $objForm.StartPosition = "CenterScreen"
and so many others and can't figure it out.
Here is the form:
$img = [System.Drawing.Image]::Fromfile($file);
[System.Windows.Forms.Application]::EnableVisualStyles();
$form = new-object Windows.Forms.Form
[void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms")
$form = New-Object Windows.Forms.Form
$form.Text = "Image Viewer"
$form.WindowState= "Maximize"
$form.ControlBox = $false
$form.FormBorderStyle = "0"
$form.BackColor = [System.Drawing.Color]::black
$pictureBox1 = New-Object Windows.Forms.PictureBox
$pictureBox1.Width = $img.Size.Width;
$pictureBox1.Height = $img.Size.Height;
$pictureBox1.Image = $img;
$form.Controls.Add($pictureBox)
$form.Add_Shown( { $form.Activate() } )
$form.ShowDialog()
#$form.Show();
$file = (Get-Item 'C:\ABCD.gif')