Example #1
0
        public static bool TryCreate(ResourceLang lang, byte[] data, out JpegImageResourceData typed)
        {
            typed = null;

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

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

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

            return(true);
        }
Example #2
0
 public override ResourceData FromResource(ResourceLang lang, byte[] data)
 {
     return(JpegImageResourceData.TryCreate(lang, data, out var rd) ? rd : null);
 }