简体   繁体   中英

Java returns wrong Image Type

Hello there fellow people of Stack Overflow. I have quite some error when it came to my methods. I have a class that is supposed to turn four integers, and an image into a cropped image. My problem is not with the coordinates of the crop, but with the arguements.

Cannot find sumbol = method GetSubImage(int, int, int, int, java.awt.Image); Maybe you meant: GetSubImg(int, int, int, int, BufferedImage) or GetSubImg(int, int, int, int, Image)

However, I am using the last method, but it sees it as java.awt.image instead of Image. I am using an Image, not the java.awt.Image.

Image Playah = CrusLib.ImgLoad("H:/ZeldaMap/Sprites/Link.png");
CrusLib.GetSubImage(x * 18, y * 18, 18, 24, Playah);

Of course, CrusLib is created before. Anyone have any idea what may be wrong?

Can you post your import statements, You are passing java.awt.Image, Check your GetSubImage to know which Image it is expecting. Meanwhile, please dont kill java by naming a method like "GetSubImage". Please change to "getSubImage"

Sorry about this post guys, but it seems to be a simple error that most coders experience at least once in their carreer.

In the error it gives me, it doesn't read the method "GetSubImage", but it recognizes "GetSubImg". The difference was that I had an extra a and e in the mix. Thanks for those who attempted to help! :)

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