コード例 #1
0
        public override ResourceData FromResource(ResourceLang lang, Byte[] data)
        {
            GifImageResourceData rd;

            if (GifImageResourceData.TryCreate(lang, data, out rd))
            {
                return(rd);
            }

            return(null);
        }
コード例 #2
0
        private static ResourceData FromFile(Stream stream, String extension)
        {
            Byte[] data = GetAllBytesFromStream(stream);

            GifImageResourceData rd;

            if (GifImageResourceData.TryCreate(null, data, out rd))
            {
                return(rd);
            }

            return(null);
        }
コード例 #3
0
        public override ResourceData FromFile(Stream stream, String extension, ResourceSource source)
        {
            Byte[] data = GetAllBytesFromStream(stream);

            GifImageResourceData rd;

            if (GifImageResourceData.TryCreate(null, data, out rd))
            {
                return(rd);
            }

            return(null);
        }
コード例 #4
0
        internal static Boolean TryCreate(ResourceLang lang, Byte[] data, out GifImageResourceData typed)
        {
            // XN Resource Editor checks if the first few bytes are a GIF signature

            typed = null;

            if (!HasGifSignature(data))
            {
                return(false);
            }

            Image image;

            if (!TryCreateImage(data, out image))
            {
                return(false);
            }

            typed = new GifImageResourceData(image, lang, data);

            return(true);
        }