简体   繁体   中英

Coverting an Int array on to a raster Java

This day i was watching this tutorial and he used this line...

private int[] pixels =((DataBufferInt)image.getRaster().getDataBuffer().getData()); 

But by some reason for him it works but for me it doesn't, i always get these two errors...

  • Type mismatch: cannot convert from DataBufferInt to int[]
  • The method getData() is undefined for the type DataBuffer

Help me pls.

I had this often. Pay attention to the parentheses:

private int[] pixels =((DataBufferInt)image.getRaster().getDataBuffer()).getData();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM