aspose file tools*
The moose likes Java in General and the fly likes java.awt.image Can't create a WriteableRaster object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.awt.image Can Watch "java.awt.image Can New topic
Author

java.awt.image Can't create a WriteableRaster object

Nate Lockwood
Ranch Hand

Joined: Feb 22, 2010
Posts: 83
Over a year ago I wrote a small application to be able to view data we collect from a specialized camera and display it as a discrete image. Last week I attempted to reuse some of the code in a new demonstratin application to collect image data from the camera and display the images sequentially as collected; kind of like a very, very, slow video at a rate of about 1 Hz (and to integrate camera controls in the GUI).

The original code works using Eclipse Juno as the IDE and Oracle Jav 7 SE. I copied a method to another computer which has Eclipse Kepler and Oracle Java 7 EE. Eclipse reports an error and I've not been able to figure out how to fix it using Google etc.

Eclipse gives the error as:
"The method createWritableRaster(SampleModel, DataBuffer, Point) in the type Raster is not applicable for the arguments (ComponentSampleModel, DataBufferUShort, Point)"

The data in shortData are a single band of raw 16 bit monochrome image data (just as received from the camera).

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

Nate Lockwood wrote:Eclipse gives the error as:
"The method createWritableRaster(SampleModel, DataBuffer, Point) in the type Raster is not applicable for the arguments (ComponentSampleModel, DataBufferUShort, Point)"

That error means that Eclipse thinks that there is no createWritableRaster method that is compatible with the arguments ComponentSampleModel, DataBufferUShort and Point.

This can have different causes. For example, are you sure you are using the right classes ComponentSampleModel, DataBufferUShort and Point; what do your imports look like? Are you sure you're using java.awt.Point, for example, and not some other class that's also named Point?

You say you have Java EE 7 on the other computer. Java EE is an extension to Java SE. You also have a Java SE version on that other computer. What is the version of that?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Nate Lockwood
Ranch Hand

Joined: Feb 22, 2010
Posts: 83
Thanks, the wrong Point was imported. Should have been the AWT Point.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.awt.image Can't create a WriteableRaster object