Git Product home page Git Product logo

bumpkit's People

Contributors

datadink avatar fschwiet avatar jimbobsquarepants avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bumpkit's Issues

Save Gif from Gif source

The demo use a static image, create multiple frame by rotation and save a gif. But if the original Image loaded is a Gif, it seems to create a corrupted file.

See this code:

        private static byte[] ToGifByteArray(Image image)
        {
            var frameCount = image.GetFrameCount(FrameDimension.Time);
            var times = image.GetPropertyItem(0x5100).Value;  // PropertyTagFrameDelay

            using (var memoryStream = new MemoryStream())
            {
                using (var encoder = new GifEncoder(memoryStream, null, null, -1))
                {
                    for (var idx = 0; idx < frameCount; idx++)
                    {
                        image.SelectActiveFrame(FrameDimension.Time, idx);
                        var dur = BitConverter.ToInt32(times, 4 * 0); 
                        encoder.AddFrame(image, 0, 0, TimeSpan.FromSeconds(dur));
                    }
                }

                File.WriteAllBytes(@"C:\test.gif", memoryStream.ToArray());
                return memoryStream.ToArray();
            }
        }

If I pass a Image loaded from a gif, it create a corrupted. If I comment the first two lines for the timing and the loop for the frame and pass a Image loaded from a jpeg, it create a working gif.

Can't upload GIF to Imgur/Twitter

Can't upload GIF produced by BumKit to Imgur/Twitter.

Here is an answer from Imgur support team, the same answer from Twitter:

"Thanks for writing! I think that's a problem with the image file. It's failing to strip the metadata during upload. Could you try another image to upload in the meantime? I've created a bug report and the developers will be looking into this."

Saving the gif created by encoder?

Hi,

Perhaps I've been doing this the wrong way im not sure - ive been using the same way as https://psycodedeveloper.wordpress.com/2013/04/26/saving-an-animated-gif-image-with-c-in-windows-forms/

For saving the created gif, but whenever I try to open it in gif viewer it causes it to crash?

Code:

using (var stream = new MemoryStream())    {        using (var encoder = new BumpKit.GifEncoder(stream))        {
for (int i = 0; i < 50; i++)
                        {
                            graphics.CopyFromScreen(region.Left, region.Top, 0, 0, region.Size);


                            CURSORINFO pci;
                            pci.cbSize = Marshal.SizeOf(typeof(CURSORINFO));


                            if (GetCursorInfo(out pci))
                            {
                                if (pci.flags == CURSOR_SHOWING)
                                {
                                    var hdc = graphics.GetHdc();

                                    DrawIconEx(hdc, pci.ptScreenPos.x - region.X, pci.ptScreenPos.y - region.Y, pci.hCursor, 0, 0, 0, IntPtr.Zero, DI_NORMAL);

                                    graphics.ReleaseHdc();

                                }
                            }
encoder.AddFrame(bitmap , 0, 0, TimeSpan.FromSeconds(0));            }

stream.Position = 0;            using (var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))            {                stream.WriteTo(fileStream);            }

} 
} 

Apologies for the format i wrote this on my phone

I capture the users screen and mouse movements to put together a gif (also how many images would it need to capture to create a smooth 20 second gif?)

Transparent Animated GIF

I have a sequence of PNG images which I want to use for generating an animated gif. The library works well by stitching the png images to make a gif but looses the transparency while conversion.

The converted gif appears to be grey and white.

Any fix for this?

Gif repeat bug

The Repeat property of the gif encoder class works with the values:
-1 = No repeat.
0 = Repeat forever.
n = +Iterations. (if n set to 3, the frames will be displayed 4 times)

The problem is, if i set n to 1, iterates 3 times. But not 2 times as expected!

Why stream dispose breaks the demo

This comment in Form1.cs, line 74:
var gifStream = new MemoryStream(); // NOTE: Disposing this stream will break this demo - I don't know why.

According to the MSDN doc for Image.FromStream(), "You must keep the stream open for the lifetime of the Image."

FYI.

Gif quality?

Is there any way to increase the quality? It's very low right now...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.