All Questions
74 questions
0
votes
1
answer
288
views
how to draw prespctive image in android canvas
i have searched about how to draw prespctive image in canvas like in the picture but i dont find anything thing. if its not possible using canvas, how i can make something like it?
i find this:-
...
1
vote
1
answer
178
views
Remove bitmap from canvas drawBitmap in Android Java
I'm currently build a flappy bird app and I want to implement the coin between pipes. The coins are successfully placed between the pipes. The problem is, when the bird hitting the coin, the coin ...
1
vote
1
answer
125
views
Drawing a graph in Paint with Android graphics
I'm trying to plot a graph on a View using a canvas. So far so good it plots correctly as show in the next image:
Desired Output
once you tap on the screen the expected result should clear the screen ...
0
votes
1
answer
58
views
How to draw a circuler path by swiping without draw edges?
How to draw a circler path by swiping, it's draw with edges.
I wanted to draw path with smooth edges.
this is my code.
this.mPaint = new Paint();
this.mPaint.setStyle(Paint.Style....
0
votes
1
answer
974
views
Draw path only in selected area of bitmap canvas android java
So I'm currently building kids coloring book app. I want to restrict the draw area so it will only can draw path in the selected area. For example, if I touch the horn, then the draw area is only the ...
-1
votes
1
answer
1k
views
Making a zoomable coordinate system in JavaFX [closed]
I want to make a kind of "zoomable graphing calculator" in javafx so basically a coordinate system where you can zoom in with the mouse wheel. Im drawing everything on a canvas but Im not ...
-1
votes
1
answer
91
views
Java AWT canvas in the output is overiding it's own graphic contents
I was practising and came across a problem with no perfect explanation of solution.
'''
package com.company;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event....
1
vote
0
answers
132
views
Java2D gradient line stroke
I would like to stroke a line with a gradient that follows the line direction:
Is it possible to achieve this with Java 2D? If not then what other Java libraries would you recommend?
3
votes
1
answer
126
views
JavaFX - rotate canvas around specific X and Y
I'm trying to draw an airplane on a canvas using SVGPath and move it based on an input of location and degree. I've managed to draw the airplane and move it correctly on the screen based on it ...
0
votes
1
answer
407
views
Java Canvas has low fps if mouse is stationary
If I'm not somehow updating the screen, several calls to canvas.repaint() seem to be just skipped altogether. While moving the mouse, everything works great.
My code is as follows:
package yeet....
0
votes
1
answer
1k
views
Are layers the only way to composite graphics on JavaFX canvas?
I am working on a gui in JavaFX which needs to composite a large number of objects (often using alpha masks and similar) on the canvas.
For comparison on the HTML5 canvas this can easily be done by ...
0
votes
1
answer
78
views
Canvas to image drawing not successful
First code snippet is my main render method. I am creating buffer strategy, then getState().render(g) is passing Graphics object and it calls a bunch of g.drawImage() methods, after all that, ...
2
votes
1
answer
487
views
Java - How can I add rgb values in an if statement?
recently I was thinking to make a game and I choose, for the making of the maps, to use an image. It's a normal image, like this:
I wanted for each red pixel (255, 0, 0) to draw black rectangles 32x32 ...
3
votes
0
answers
562
views
2D Game graphics in native Java: Canvas vs. JComponent
Apparently there are multiple ways of drawing game graphics in Java. All of them seem reasonable, yet I can't find out which way is the "best" way in terms of speed/efficiency:
Using the Canvas class ...
1
vote
0
answers
102
views
Is it not a good idea to use Graphics to clear the screen every frame? (Java)
So after looking at multiple ways to paint or draw things onto the canvas/screen, I tested out my own way that seems to work, no problem. I simply just g.clearRect(0, 0, width, height) on an update ...