problem in using magic collection

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
wael
Posts: 5
Joined: 2016-04-02T11:00:27-07:00
Authentication code: 1151

problem in using magic collection

Post by wael »

I have a sequance of photos (0.png, 1.png , 2.png....)
I try to convert them to an animated gif using vb.net. I found this code but nothing happens and the form close.. This is code


Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim photos As String() = Directory.GetFiles(Application.StartupPath, "*.png")
Using collection As New MagickImageCollection()
Dim iarray As Integer = 0
For Each name As String In photos
collection.Add(name)
collection(iarray).AnimationDelay = 0
iarray += 1
Next

Dim settings As New QuantizeSettings()
settings.Colors = 256
collection.Quantize(settings)

collection.Optimize()
collection.Write("imagemagick.gif")

End Using
End Sub
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: problem in using magic collection

Post by dlemstra »

Your code looks correct. You don't see the file ImageMagick.gif in the folder of your executable?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
wael
Posts: 5
Joined: 2016-04-02T11:00:27-07:00
Authentication code: 1151

Re: problem in using magic collection

Post by wael »

No i didnt . and the form close
wael
Posts: 5
Joined: 2016-04-02T11:00:27-07:00
Authentication code: 1151

Re: problem in using magic collection

Post by wael »

The steps i did :
Adding refrence Magick.NET-Q8-x64.dll for frame work 4.0 profile client
The names of photos are 0.png 1.png 2.png in debug folder
Post Reply