View Single Post
Old 08-09-2007   #1 (permalink)
Luke


 
 

Viewing an image from within Powershell

I want to create a separate window (with the system.windows.forms class) and
view images from a URL through the new window. As my .NET skills are lacking,
this is what I've managed to whip up so far:

[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$form = new-object System.Windows.Forms.form
$form.MaximizeBox = $false;
$form.MinimizeBox = $false;
$form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen
$form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::FixedDialog
$form.ShowDialog()

I'm still uncertain how I would go about pulling images from the web and
viewing it from this window (System.Windows.Media.Imaging maybe?). Also how
do I set the autosize property correctly so that the window resizes itself
according to the image size?
My System SpecsSystem Spec