|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
Resizing ImagesThe 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 |
|
|
Re: Re sizing ImagesHi,
Please file a bug report in bugzilla.novell.com with a complete (compilable) test case. Rolf > -----Original Message----- > From: mono-vb-bounces@... [mailto:mono-vb- > bounces@...] On Behalf Of Easy_Rider9999 > Sent: domingo, 16 de agosto de 2009 11:45 > To: mono-vb@... > Subject: [mono-vb] Re sizing Images > > > 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. > > _______________________________________________ > Mono-vb mailing list > Mono-vb@... > http://lists.ximian.com/mailman/listinfo/mono-vb _______________________________________________ Mono-vb mailing list Mono-vb@... http://lists.ximian.com/mailman/listinfo/mono-vb |
|
|
Re: Re sizing ImagesI have done this before with my other program Repetit.Net.T.SQLITE. My program and source code is available at SourceForge: http://sourceforge.net/projects/photoprinter/ if anybody likes to test it. Regards Hans |
|
|
Re: Re sizing ImagesHii Hans
I am unable get the data from that zip file downloaded. Pl. check
Thanks
On Wed, Sep 9, 2009 at 5:38 PM, Rolf Bjarne Kvinge <rolflists@...> wrote: Hi, _______________________________________________ Mono-vb mailing list Mono-vb@... http://lists.ximian.com/mailman/listinfo/mono-vb |
|
|
Re: Re sizing ImagesI will upload a tar.gz File and the newest Source Code soon. But actually I could open also the zip-file with Ubuntu 8.04...... Regards Hans |
|
|
Re: Re sizing ImagesI have uploaded new files to https://sourceforge.net/projects/photoprinter/files/ and left the old files for comparison. Regards Hans |
|
|
Re: Resizing ImagesI have found out why resizing does not work! The dialogresult for frmResizePictures is "Cancel" instead of "OK" if you click on the resize button! This happens although I have set the dialogresult for the resize button to OK. I am working on a workaround now.
Regards Hans |
|
|
Re: Resizing ImagesThe workaround worked only partially. The OK button is now interpreted as OK, but the YES-Button of an msgbox gives the Result NO!!!!!!!! I really get very unmotivated for Mono.... Regards Hans |
|
|
Re: Resizing ImagesIf you want Mono to get better, then file bug reports. |
|
|
Re: Resizing ImagesI have made some more workarounds and my app runs fairly well in my own Ubuntu 8.04 environment with my self-compiled Mono 2.4.2.3 (with libgdiplus) but with the 2.4.2.3 Suse Virtual PC Image my app crashes when opening a folder with pictures! Is libgdiplus missing in this image? Here is the error message: ucPictureListview.DrawLVItem SetImages to unsaved Items and checked Items /home/rupert/Desktop/TestTest/DSC03690.JPG System.ArgumentOutOfRangeException: Index is less than 0 or more than or equal to the list count. Parameter name: index 4 at System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException (System.String name, System.Object actual, System.String message) [0x00000] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/corlib/System.Collections/ArrayList.cs:3258 at System.Collections.ArrayList.get_Item (Int32 index) [0x00013] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/corlib/System.Collections/ArrayList.cs:2649 at System.Windows.Forms.ImageList+ImageCollection.GetImage (Int32 index) [0x00024] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs:678 at System.Windows.Forms.ImageList.Draw (System.Drawing.Graphics g, Int32 x, Int32 y, Int32 index) [0x00000] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs:1128 at System.Windows.Forms.ImageList.Draw (System.Drawing.Graphics g, Point pt, Int32 index) [0x00000] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs:1123 at (wrapper remoting-invoke-with-check) System.Windows.Forms.ImageList:Draw (System.Drawing.Graphics,System.Drawing.Point,int) at System.Windows.Forms.ThemeWin32Classic.DrawListViewItem (System.Drawing.Graphics dc, System.Windows.Forms.ListView control, System.Windows.Forms.ListViewItem item) [0x0029f] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs:2963 at System.Windows.Forms.ThemeWin32Classic.DrawListViewItems (System.Drawing.Graphics dc, Rectangle clip, System.Windows.Forms.ListView control) [0x00074] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs:2655 at System.Windows.Forms.ListView+ItemControl.OnPaintInternal (System.Windows.Forms.PaintEventArgs pe) [0x00000] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs:3027 at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) [0x00078] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5559 at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x0016c] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5319 at System.Windows.Forms.ListView+ItemControl.WndProc (System.Windows.Forms.Message& m) [0x0009a] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs:3050 at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:234 at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:215 at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00085] in /usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:242 ucPictureListview.DrawLVItem Finished ucPictureListview.OnScrollFinished Finished frmMain.clsTV_FolderSelected addPathToFolders frmMain AddPathToFolders Start frmMain AddPathToFolders AddFolder: 1 frmMain AddPathToFolders Finished clsFolderTreeview.clsTVAfterSelect Finished frmMain.clsTVAfterSelect Start Regards Hans |
|
|
Re: Resizing ImagesAt the risk of being annoying, I'd like to stress again the importance of reporting bugs so they get fixed (not sure whether you reported it or not, so ignore this if you did). Workarounds are just hacks, they can be handy, but they're not long-term solutions. They're more or less dirty, can cause issues, may not work with other Mono versions, make maintenance more annoying, and so on... Personally, I add a hack only when I really need to, report the bug if it's not known, and remove the hack as soon as a stable Mono version has fixed the concerned issue. That said, I can't guess the root of your problem from your error. In case that might help, I can tell you I had crashes when opening files with my app on openSUSE, and which were due to the fact I tried to open these files with FileAccess.ReadWrite (the default FileAccess parameter), while I didn't have write access for these files. So now I only open files with FileAccess.Read, and catch UnauthorizedAccessExceptions (and also IOExceptions while I'm there). |
|
|
Re: Resizing ImagesI have reported the bugs to Bugzilla, but they want to have a special test case, but I really don't have time to write a special test case. Anyway I made workarounds for most bugs. Regards Hans |
| Free embeddable forum powered by Nabble | Forum Help |