ich möchte ein Bild oder PDF anzeigen nachdem ich ein File angeklickt habe.
Mein Dokument ist aber immer weiß und leer
hier mein code
gambas code
Private $PDF_Document As New PdfDocument Private $aImages As New Image[] ex As String hImage As Image Public Sub Form_Open() Dim rechnungEinOrdner As String rechnungEinOrdner = "/home/" & user.Name & "/" & FMain.myordner & "/Rechnungen_ein" DirChooser1.Root = rechnungEinOrdner FileView1.Dir = rechnungEinOrdner End Public Sub FileView1_Click() Dim p As String p = FileView1.Dir & "/" & FileView1.Current Dim ex As String TextBox1.Text = File.Ext(p) Select Lower(File.Ext(p)) Case "txt", "xml", "conf", "class", "log", "dat", "py", "pl", "php", "html" ex = "txt" Case "pdf" $PDF_Document.Open(p) DocumentView1.Count = 1 DocumentView1.Refresh() ex = "pdf" Case "png", "jpg", "jpeg", "gif" hImage = Image.Load(p) DocumentView1.Count = 1 ex = "pic" TextBox1.Text = p End Select End Public Sub DocumentView1_Draw(Page As Integer, Width As Integer, Height As Integer) If ex = "pdf" Then Paint.DrawImage($PDF_Document[Page + 1].Image, 0, 0, Paint.Width, Paint.Height) Endif If ex = "pic" Then Paint.DrawImage(hImage, 0, 0, Width, Height) Endif End Public Sub DocumentView1_Zoom() $PDF_Document.Zoom = Last.Zoom End Public Sub DocumentView1_Layout(Page As Integer) If ex = "pdf" Then DocumentView1.Layout.Width = $PDF_Document[Page + 1].Width - 10 DocumentView1.Layout.Height = $PDF_Document[Page + 1].Height Endif If ex = "pic" Then DocumentView1.Layout.Width = hImage.W DocumentView1.Layout.Height = hImage.H Endif End Public Sub Button9_Click() Me.Close End Public Sub DirChooser1_Change() FileView1.Dir = DirChooser1.SelectedPath End