import System
import System.IO
import clr
import sys
import os
clr.AddReference("Ans.Utilities")
clr.AddReference("Ans.UI.Toolkit")
clr.AddReference("Ans.UI.Toolkit.Base")
from Ansys.Utilities import *
from Ansys.UI.Toolkit import *
from Ansys.UI.Toolkit.Drawing import *

class ImageViewer(Dialog):
    def __init__(self,filename):
        Dialog.__init__(self)

        reader = System.IO.StreamReader(filename)
        img = Image.FromStream(reader.BaseStream)
        reader.Close()
        label = Label()
        label.Image = img
        self.ClientSize = img.Size

        self.SetControl(label)
