Description
The CreateFromPsdBytes
method is a static method of the Bitmap
class in the Sandbox namespace. It is used to create a Bitmap
object from a byte array containing PSD (Photoshop Document) data. This method is useful for loading and manipulating PSD files within the Sandbox environment.
Usage
To use the CreateFromPsdBytes
method, you need to provide a byte array that contains the PSD data. The method will return a Bitmap
object that represents the image data from the PSD file.
Ensure that the byte array is correctly formatted as a PSD file, otherwise the method may not function as expected.
Example
// Example of using CreateFromPsdBytes
byte[] psdData = File.ReadAllBytes("path/to/your/file.psd");
Bitmap bitmap = Bitmap.CreateFromPsdBytes(psdData);
// Use the bitmap object as needed
if (bitmap != null)
{
// Perform operations on the bitmap
Console.WriteLine($"Bitmap Size: {bitmap.Width}x{bitmap.Height}");
}