Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

method returning an object

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
getDataElements
public Object getDataElements(int x,
int y,
int w,
int h,
Object outData)
I don't get this method it is raster class and is meant to return the pixel data of an image but when I try to use it I get exceptions and basically don't understand what kind of object I should passing at the end of the method and what kind of object I should be saying it should be.
bad wording sorry; eg. should it be Integer myInts = (Integer)myRaster.getDataElements(0, 0, 100, 100, myInts)

Or

Object myInts = myRaster.getDataElements(0, 0, 100, 100, null) etc etc

I do not understand this method at all. I can use other methods to get an array from the image but this is meant to be more efficient can anyone help?
 
Looking at the JavaDoc it looks like you get back a DataBuffer object. You get the type by calling getTransferType()...this gives you an int which will map to the static values in DataBuffer
e.g. if (getTransferType().equals(DataBuffer.TYPE_BYTE) then this is byte data...

No idea where you go from there as I haven't done any graphic stuff. Hope this helps you to progress. My Home -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top