public static void Run()
{
// ExStart:UncompressedImageStreamObject
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_PSD();
// Create an instance of MemoryStream to hold the uncompressed image data.
using (MemoryStream stream = new MemoryStream())
{
// First convert the image to raw PSD format.
using (PsdImage psdImage = (PsdImage)Image.Load(dataDir + "PsdImage.psd"))
{
PsdOptions saveOptions = new PsdOptions();
saveOptions.CompressionMethod = CompressionMethod.Raw;
psdImage.Save(dataDir + stream + "_out", saveOptions);
}
// Now reopen the newly created image.
using (PsdImage psdImage = (PsdImage)Image.Load(dataDir + stream + "_out"))
{
Graphics graphics = new Graphics(psdImage);
// Perform graphics operations.
}
}
// ExEnd:UncompressedImageStreamObject
}
}