MyPSD::CPSD is a C++ class that can load images saved in Adobe's Photoshop native format. I have ported my original code to work under the PocketPC platform.
Using MyPSD::CPSD in your projects
To use the class, just include in your project the two files, MyPSD.h/.cpp. Since the class is placed inside its own namespace, either use the full name,
MyPSD::CPSD psd;, or first the directive,
using namespace MyPSD; and then just declare a local variable
How to use MyPSD::CPSD
MyPSD::CPSD psd; int nErrorCode = psd.Load("c:\\image.psd");
if ( 0 == nErrorCode )
int nDPI_x, nDPI_y;
int nWidth, nHeight;
HBITMAP hBitmap = psd.Detach();
else if ( -1 == nErrorCode )
else if ( -2 == nErrorCode )
else if ( -3 == nErrorCode )
else if ( -4 == nErrorCode )
else if ( -5 == nErrorCode )
else if ( -6 == nErrorCode )
else if ( -7 == nErrorCode )
else if ( -8 == nErrorCode )
else if ( -9 == nErrorCode )
else if ( -10 == nErrorCode )
else if ( -11 == nErrorCode )
else if ( -12 == nErrorCode )
The following formats are supported: RGB, Lab, CMY, CMYK, Indexed, Grayscale, Duotone. These formats could be uncompressed or compressed with RLE.
Unsupported formats/Not yet implemented
Bitmap (Black and White), and any format that is compressed with ZIP with prediction and without prediction, and that is basically because I don't know the ZIP compression algorithm (with and without prediction).
MyPSD::CPSD is free; but if you are to use it in any kind of software, especially commercial ones, I would appreciate if you could just email me; it's nice to learn that something you've written is used by others.
I would like to thank image_processor of this forum for fixing a bug I had in the original code.