如何创建一个Graphics2D实例? [英] How to create a Graphics2D instance?

查看:195
本文介绍了如何创建一个Graphics2D实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在最简单的方法的Java SE 7 以获得实例只是绘制几个点进行调试?桌面环境。

What's the easiest way in Java SE 7 to obtain an instance just to plot a few points for debugging? Desktop environment.

推荐答案

您可以使用的BufferedImage

BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics2D = image.createGraphics();

这篇关于如何创建一个Graphics2D实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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