[mono-vb] Re sizing Images

Easy_Rider9999 jhmgbl2 at t-online.de
Sun Aug 16 05:45:23 EDT 2009


The following code works with .Net Framework but not with Mono. What is
wrong! No new files are generated!


gStatus = CodeLoc & " Sizing Image"
              Using newImage As Image = clsGrafics.SizeImage(_size, img)
                gStatus = CodeLoc & " Copy Exif"
                clsExif.Copy(img, newImage)
                img.Dispose()
                img = Nothing
                Dim f As String
                BackPath = ""
                If optNewName.Checked Then
                  Action = ClsGlobal.GetLang("ResizeNewName", "Verkleinern
in neue Datei", Me)
                  ActionType = clsUndo.EnumActionType.Resize
                  f = Me.GetRenamePath(sPictures(i))
                ElseIf optFolder.Checked Then

                  Action = ClsGlobal.GetLang("ResizeNewFolderName",
"Verkleinern in Ordner", Me)
                  ActionType = clsUndo.EnumActionType.Resize
                  f = IO.Path.Combine(txtFolder.Text,
IO.Path.GetFileName(sPictures(i)))
                ElseIf optOverwrite.Checked Then
                  Action = ClsGlobal.GetLang("ResizeNewName", "Verkleinern",
Me)
                  ActionType = clsUndo.EnumActionType.Resize
                  BackPath = ClsGlobal.GetBackPath(sPictures(i))
                  Try
                    gStatus = CodeLoc & " Renaming File " & sPictures(i) & "
to: " & BackPath
                    My.Computer.FileSystem.RenameFile(sPictures(i),
IO.Path.GetFileName(BackPath))
                    f = sPictures(i)
                    blnOverWrite = True
                  Catch ex As Exception
                    f = ""
                    MsgBox(ex.Message)
                  End Try

                Else
                  Throw New ApplicationException("No option selected!")
                End If
                If Not blnOverWrite Then
                  ClsGlobal.gStatusLabel.Text =
ClsGlobal.GetLang("CreatingResizeFile", "Erstelle neue verkleinerte Datei
für ", Me) & sPictures(i)
                Else
                  ClsGlobal.gStatusLabel.Text =
ClsGlobal.GetLang("ResizingFile", "Speichere verkleinerte Datei für ", Me) &
sPictures(i)
                End If
                gStatus = CodeLoc & " " & ClsGlobal.gStatusLabel.Text
                My.Application.DoEvents()
                If f <> "" Then
                  Try
                    gStatus = CodeLoc & " Saving NewImage to File " & f
                    clsGrafics.SaveImg(newImage, f, tbCompr.Value)
                    frmMain.AddToUndo(f, BackPath, Action, ActionType)
                  Catch ex As Exception
                    MsgBox(ex.Message)
                  End Try
                End If
                Pictures(i) = f
              End Using


-- 
View this message in context: http://www.nabble.com/Resizing-Images-tp24991889p24991889.html
Sent from the Mono - VB mailing list archive at Nabble.com.



More information about the Mono-vb mailing list