using WebPWrapper; Image imgPhoto = null; if (Path.GetExtension(pathFileName) == ".webp") { //FileStream stream = new FileStream(pathFileName, FileMode.Open, FileAccess.Read); //imgPhoto = Image.FromStream(stream); //pictureBox.Image = imgPhoto; WebP webp = new WebP(); pictureBox.Image = webp.Load(pathFileName); } else { FileStream stream = new FileStream(pathFileName, FileMode.Open, FileAccess.Read); imgPhoto = Image.FromStream(stream); pictureBox.Image = imgPhoto; } //other, convert webp file to byte[] WebP webp = new WebP(); string pathFileName = openFileDialog.FileName; byte[] rawWebp = File.ReadAllBytes(pathFileName); webp.GetInfo(rawWebp, out width, out height, out has_alpha, out has_animation, out format); //rawWebp not null //error to create ms MemoryStream ms = new MemoryStream(rawWebp);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)