我可以使用图片而不是在jav中绘图吗? [英] Can I use picture instead of drawing in jav?

查看:94
本文介绍了我可以使用图片而不是在jav中绘图吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好编码员,我班上有一个项目,我必须建立一个基于大富翁游戏的游戏。这是我的问题,我知道我可以用Java绘制游戏中的棋盘游戏和其他对象,但是我可以插入图片而不是绘图吗?是否有任何代码可以帮助我在Java中插入图片?当图片插入某个类时,我可以使用它来放置令牌,或者当令牌移动到图片上的该属性时显示该属性的信息吗?谢谢btw



我尝试了什么:



我写点东西给满足你有什么尝试?的要求。

解决方案

据我所知,你正在寻找从保存的位图中绘制图片(你正在调用它)作为插入?)而不是通过绘制线,圆和其他形状?如果它是正确的,JAVA支持它,请参考绘制图像(The Java™)教程> 2D图形>使用图像) [ ^ ]



还尝试谷歌如何绘制位图。


Hello coders, I have a project in my class, I have to build a game base on Monopoly game. Here is my Question, I knew that I can draw in Java to get the board game and the other object in the game, but can I insert a picture instead of drawing? Is it any code that helps me to insert a picture in Java? When a picture insert into a class, can I use it to place the tokens on or show the information of the property when a token move to that property on the picture? Thank btw

What I have tried:

I write something to fulfil the requirement of "What have you tried?".

解决方案

As I can understand that you are looking to draw a picture from a saved bitmap (you are calling it as insert?) and not by drawing line, circle and other shapes? If it is correct, there are support in JAVA for it, please refer Drawing an Image (The Java™ Tutorials > 2D Graphics > Working with Images)[^]

Also try to google on how to draw a bitmap.


这篇关于我可以使用图片而不是在jav中绘图吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆