This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Open the HEIC file named "filename.heic" in read mode using FileStream. | |
using (var fs = new FileStream("filename.heic", FileMode.Open)) | |
{ | |
// Load the HEIC image from the file stream into a HeicImage object. | |
HeicImage image = HeicImage.Load(fs); | |
// Extract the pixel data from the HEIC image in the BGRA32 format, storing it in a byte array. | |
var pixels = image.GetByteArray(Heic.Decoder.PixelFormat.Bgra32); | |
// Retrieve the width and height of the HEIC image. | |
var width = (int)image.Width; |