Exemple #1
0
        public override ResourceData FromResource(ResourceLang lang, Byte[] data)
        {
            JpegImageResourceData rd;

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

            return(null);
        }
Exemple #2
0
        public static Boolean TryCreate(ResourceLang lang, Byte[] data, out JpegImageResourceData typed)
        {
            typed = null;

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

            Image image;

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

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

            return(true);
        }