ImageConverter

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
Gateway
Posts: 2
Joined: 2014-01-04T05:12:55-07:00
Authentication code: 6789

ImageConverter

Post by Gateway »

First of all, sorry for bad English.
I'm using ImageMagick.NET library to create simple Multi-Image Converter. This is the problem:

Code: Select all

Value of type 'ImageMagick.MagickFormat' cannot be converted to 'System.Drawing.Imaging.ImageFormat'.
This is conversation code:

Code: Select all

If DataGridView1.Rows.Count > 0 And FolderBrowserDialog1.ShowDialog <> DialogResult.Cancel Then
            Dim j As Integer = 0
            Dim spath As String = ""
            Dim fpath As String = FolderBrowserDialog1.SelectedPath
            For j = 0 To DataGridView.Rows.Count - 1
                spath = fpath & "\" & DataGridView1.Item(0, j).Value.ToString.Substring(dgvFiles.Item(0, j).Value.ToString.LastIndexOf("\") + 1, (DataGridView1.Item(0, j).Value.ToString.LastIndexOf(".") - DataGridView1.Item(0, j).Value.ToString.LastIndexOf("\")) - 1)
                PictureBox1.Image = Image.FromFile(dgvFiles.Item(0, j).Value.ToString)
                ElseIf combobox1.SelectedItem = "Joint Photographic Experts Group (JPG)" Then
                 PictureBox1.Image.Save(spath & ".jpg", ImageMagick.MagickFormat.Jpg)
Can someone help me please with this problem?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: ImageConverter

Post by dlemstra »

What are you trying to accomplish? If your 'PictureBox1.Image' is a Bitmap you should use the constructor of MagickImage that accepts a Bitmap.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Gateway
Posts: 2
Joined: 2014-01-04T05:12:55-07:00
Authentication code: 6789

Re: ImageConverter

Post by Gateway »

dlemstra wrote:What are you trying to accomplish? If your 'PictureBox1.Image' is a Bitmap you should use the constructor of MagickImage that accepts a Bitmap.
Yes, I can do that and that is good idea, but how? :(
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: ImageConverter

Post by dlemstra »

If you don't know how to call a constructor you should first learn how to do this before using Magick.NET. I am sorry but I cannot help you with learning how to write programs.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Farah_chew
Posts: 1
Joined: 2014-04-27T21:53:10-07:00
Authentication code: 6789

Re: ImageConverter

Post by Farah_chew »

Thanks for sharing this code, i was searching for this only.
thanks and regards
Farah
Post Reply