You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Read from file.usingvarimageFromFile=newMagickImage(SampleFiles.SnakewareJpg);// Read from stream.usingvarmemStream=LoadMemoryStreamImage();usingvarimageFromStream=newMagickImage(memStream);// Read from byte array.vardata=LoadImageBytes();usingvarimageFromBytes=newMagickImage(data);// Read image that has no predefined dimensions.varsettings=newMagickReadSettings();settings.Width=800;settings.Height=600;usingvaryellow=newMagickImage("xc:yellow",settings);usingvarimage=newMagickImage();image.Read(SampleFiles.SnakewareJpg);image.Read(data);image.Read("xc:yellow",settings);usingvarstream=LoadMemoryStreamImage();image.Read(stream);
Read basic image information:
// Read from filevarinfo=newMagickImageInfo(SampleFiles.SnakewarePng);// Read from streamusingvarmemStream=LoadMemoryStreamImage();info=newMagickImageInfo(memStream);// Read from byte arrayvardata=LoadImageBytes();info=newMagickImageInfo(data);info=newMagickImageInfo();info.Read(SampleFiles.SnakewarePng);usingvarstream=LoadMemoryStreamImage();info.Read(stream);info.Read(data);Console.WriteLine(info.Width);Console.WriteLine(info.Height);Console.WriteLine(info.ColorSpace);Console.WriteLine(info.Format);if(info.Densityis not null){Console.WriteLine(info.Density.X);Console.WriteLine(info.Density.Y);Console.WriteLine(info.Density.Units);}
Read image with multiple layers/frames:
// Read from fileusingvarimagesFromFile=newMagickImageCollection(SampleFiles.SnakewareJpg);// Read from streamusingvarmemStream=LoadMemoryStreamImage();usingvarimagesFromStream=newMagickImageCollection(memStream);// Read from byte arrayvardata=LoadImageBytes();usingvarimagesFromByteArray=newMagickImageCollection(data);// Read pdf with custom density.varsettings=newMagickReadSettings();settings.Density=newDensity(144);usingvarpdf=newMagickImageCollection(SampleFiles.SnakewarePdf,settings);usingvarimages=newMagickImageCollection();images.Read(SampleFiles.SnakewareJpg);usingvarstream=LoadMemoryStreamImage();images.Read(stream);images.Read(data);images.Read(SampleFiles.SnakewarePdf,settings);