简体   繁体   English

Java与C#图形对象等效吗? (包括更多详细信息)

[英]What is the Java equivalent of a C# Graphics object? (more details included)

In a C# Windows form, there is a Graphics object which is used to draw images and shapes directly to the form. 在C#Windows窗体中,有一个Graphics对象,该对象用于直接在窗体上绘制图像和形状。 What is the equivalent in Java? Java中的等效功能是什么?

In case my question isn't clear enough, I wish to draw to a form in Java like I would in C#. 如果我的问题还不够清楚,我希望可以像使用C#一样绘制Java表单。 I am aware of Applets and JApplets, but I want to do this in an actual form and not in a browser. 我知道Applets和JApplets,但是我想以实际的形式而不是在浏览器中进行操作。

It's also Graphics in Java. 它也是Java中的Graphics (Surprise!) (惊讶!)

Sometimes you need to cast the object to Graphics2D for more advanced graphics manipulations. 有时您需要将对象强制转换Graphics2D才能进行更高级的图形操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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