java.lang.IllegalArgumentException: Unknown color space
at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:791)
at ImageReader.makeColorModel(ServDB.java:275)
at ImageReader.makeImage(ServDB.java:211)
at ServDB.main(ServDB.java:73)
Exception in thread "main"
Tool completed with exit code 1
The Code :
// This method retrieves a ColorModel for use in constructing theimage
private static ComponentColorModel makeColorModel() {
ComponentColorModel myModel = new ComponentColorModel(
new ICC_ColorSpace(ICC_Profile.getInstance(ColorSpace.TYPE_3CLR)), // A three-band colorspace
new int[] {8,8,8}, // 8-bit color for each band
false, // Has no alpha value
false, // Alpha value is not premultiplied
java.awt.Transparency.OPAQUE, // The image is opaque
DataBuffer.TYPE_INT); // The type of array data is stored in
return myModel;
}
The Point :
I'm reading in RGB data from a string, and building an image out of it. So I need a color model, and I'm using their inbuilt model for generic
3-color! Help!
-Tennessee
> I'm reading in RGB data from a string, and building an image out of it.
Very bad thing there. Pretty much guaranteed to break on you.
See my response to your "Large Strings" post.