File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nate Lockwood
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Nate Lockwood
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, the wrong Point was imported. Should have been the AWT Point.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic