Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sout"></param>
        /// <param name="globalCm"></param>
        /// <param name="loops">Netscape 2/0 extension for animation loop count. 0 - infinite, -1 for not used. -1 is default</param>
        public void GifAnimBegin(Stream sout, bool globalCm, int loops)
        {
            int size;

            using (GDIntPtr rawdata = GDImport.gdImageGifAnimBeginPtr(this.Handle, out size, BoolToInt(globalCm), loops))
            {
                if (rawdata.IsNull)
                {
                    throw new ApplicationException("Function GifAnimBegin failed");
                }
                byte[] data = new byte[size];
                Marshal.Copy(rawdata, data, 0, size);
                sout.Write(data, 0, size);
            }
        }
Ejemplo n.º 2
0
        public void GifAnimAdd(Stream sout, int localCm, int leftOfs, int topOfs, int delay, Disposal disposal, GD previm)
        {
            int    size;
            IntPtr prevhandle = previm == null ? IntPtr.Zero : previm.handle.Handle;

            using (GDIntPtr rawdata = GDImport.gdImageGifAnimAddPtr(this.Handle, out size, localCm, leftOfs, topOfs, delay, (int)disposal, prevhandle))
            {
                if (rawdata.IsNull)
                {
                    throw new ApplicationException("Function GifAnimAdd failed");
                }
                byte[] data = new byte[size];
                Marshal.Copy(rawdata, data, 0, size);
                sout.Write(data, 0, size);
            }
        }