在Java图形中绘制曲线2D

问题描述如何使用JavaGraphics2D绘制曲线?推荐答案如果您只想绘制曲线,请使用提供.moveTo(x,y)、.lineTo(x,y)、.curveTo(cp1x,cp1y,cp2x,cp2y,endx,endy)和.quadTo(cpx,cpy,endx,endy)方法

发布:2022-10-16 标签:javadrawingcurvegraphics2d


在 JFrame 上画一条线

问题描述我正在尝试使用Graphics2D绘制一条线,但随后这条线出现在所有JFrame中的其他组件,从而使它们不可见.我该如何解决这个问题?IamtryingtodrawalineusingtheGraphics2Dbutthenthelineappearsoverallthe

发布:2022-10-16 标签:javaswingjframegraphics2d


如何根据二维数组上的特定位置获取网格单元的状态

问题描述考虑一个具有n行和n列(此处为75x75)的2D网格.鼠标单击时在每个单元格中绘制符号(标记).下面的代码用于在单元格内绘制网格线和符号:Considera2Dgridwithnrowsandncolumns(here75x75).Thesymbols(tokens)ar

发布:2022-10-16 标签:javagridswingpath-findinggraphics2d


图像质量在 Java Graphics2D Rotate 中被破坏

问题描述我在使用Graphics2D旋转方法旋转图像时遇到问题.IamexperiencinganissuewithrotatinganImagewiththeGraphics2Drotatemethod.这是我遇到的问题的图片:Here'sanimageoftheissueI'

发布:2022-10-16 标签:imagejavarotationgraphics2d


到达指定位置后如何旋转矩形?

问题描述我想旋转一个矩形,例如y位置达到指定位置.我想在路口表现出一个矩形作为汽车-只需转动例如对.我更喜欢旋转并继续.Iwouldliketorotatearectanglewhene.g.ypositionachievespecifiedposition.Iwouldlike

发布:2022-10-16 标签:javarotationswingawtgraphics2d


将java中的图像旋转指定角度

问题描述这是在给定坐标处绘制形状的函数:Here'sthefunctionwhichdrawsashapeatthegivencoordinates:publicvoiddrawTank(intx,inty){inth=50;intw=50;graphic.setColor(Co

发布:2022-10-16 标签:imagejavarotationgraphics2d


在 Java 中旋转缓冲图像

问题描述我正在尝试在java中旋转缓冲图像.这是我正在使用的代码:publicstaticBufferedImagerotate(BufferedImagebimg,doubleangle){intw=bimg.getWidth();inth=bimg.getHeight();G

发布:2022-10-16 标签:javarotationimage-rotationgraphics2dbufferedimage


游戏的无限背景

问题描述我正在开发一个Java项目,以在框架中模拟直升机的飞行.直升机使用箭头键在屏幕上移动.我希望直升机能够无限移动,即当直升机到达画面边缘时,背景应该向相反的方向移动,以产生无限地形的效果.IamworkingonaJavaprojecttosimulatetheflight

发布:2022-10-16 标签:javabackgroundswingjpanelgraphics2d


使用 Graphics2D 使用亚像素级精度绘制图像

问题描述我目前正在尝试像在电子游戏中一样以正常速度在屏幕上绘制图像.Iamcurrentlyattemptingtodrawimagesonthescreenataregularratelikeinavideogame.不幸的是,由于图像移动的速度,有些帧是相同的,因为图像还没有

发布:2022-10-16 标签:imagejavagraphicsgraphics2dsubpixel


需要 Line2D 装饰技巧 - Graphics2D

问题描述我通过Graphics2D绘图在我的JPanel上布置了Line2D和Arc2D对象.你可以看看这个问题的一部分如何制作像素完美的Line2Din-Graphics2D".现在我想要实现的是,我想为所有Line2D和Arc2D对象创建两条平行线和弧.视觉上,IhaveLi

发布:2022-10-16 标签:javagraphicsjava-2dgraphics2d