Questions tagged [graphics]

Graphics are visual presentations. Questions using this tag should also be tagged with the appropriate language and graphics subsystem in use. For more general graphics questions, consider Computer Graphics Stack Exchange (computergraphics.stackexchange.com).

graphics
Filter by
Sorted by
Tagged with
4 votes
2 answers
682 views

Drawing a clock timer with a fill

I'm trying to make a timer that mimics a clock, with a ticking hand. I have no problem drawing a clock texture and then a line for the hand, but I also want the space behind the clock hand to have a ...
Zayats's user avatar
  • 281
-2 votes
1 answer
81 views

Can't change the color of my ovals

I for some reason, unknown to me, I cannot figure out how to change the color of the ovals. They stay black even though I have set them up to be red and blue. Thanks for any help. ControlPanel class ...
Darby Vance's user avatar
1 vote
1 answer
256 views

GLSL per pixel lighting issue

I am having issues with per pixel lighting, as the light gets closer to the object it starts doing weird things like this https://i.stack.imgur.com/M8Txl.jpg. Also when the camera gets too close i ...
Dunlak's user avatar
  • 13
0 votes
0 answers
405 views

Why do you have to create a new Image to work with its Graphics in Slick2D?

I need to get a rotated version of an Image in Slick2D and as the Image is not actually rotated when you call the setRotation(..) method, but only is rotated when its drawn in a Graphics context, I ...
flotothemoon's user avatar
  • 1,892
1 vote
1 answer
186 views

How to prevent Java from erasing content if screen is minimized?

This is a current problem I am facing for a game. It is a game of Tic-Tac-Toe the user and a friend can play together. I'm not finished yet, but this is what I've got. Any time the window is minimized ...
c0smos's user avatar
  • 11
1 vote
0 answers
433 views

Reading levels of the hierarchical z buffer in a shader

I know how to read values of the z buffer in a shader, by making giving a frame buffer a depth texture and then rendering to that and using the texture normally later. However, for my purposes, I ...
Dan Webster's user avatar
  • 1,223
0 votes
1 answer
85 views

How to get 2 touches on the same rectangle

So i want to get two touches from one rectangle. So what i am doing is this Rectangle reset = new Rectangle(120, 40, 300, 100, act.getVertexBufferObjectManager()) { @Override ...
rush2sk8's user avatar
  • 372
0 votes
1 answer
1k views

Rotating multiple images causing flickering. Java Graphics2D

I am creating a top down shooter that has zombies follow you and rotate to aim directly at you. If there are up to 5 zombies following there is no flickering. If there are over 5 zombies there is a ...
Michael Haywood's user avatar
3 votes
1 answer
4k views

Ray Tracing Noise

I was wondering if someone with ray tracing experience could help me figure out a couple problems in my program, however I cannot post much code as this program is a school assignment. I was just ...
FateNuller's user avatar
-2 votes
1 answer
346 views

Graphics2D fillPolygon

I am trying to make a close button in an undecorated JFrame. I have made a Polygon Polygon closePol = new Polygon( new int[] {getWidth() - 25, getWidth(), getWidth(), getWidth() - 25}, ...
usama8800's user avatar
  • 883
1 vote
1 answer
136 views

Unwanted button painting on Panel

So I am making a simple paint program, and I have two panels. The first panel is center right and is the canvas. The other, docked on the right and is to hold tool buttons, but it currently has only a ...
user avatar
0 votes
1 answer
77 views

Why does the "Dopplr’s coloring algorithm" produce a color?

I stumbled over this blogpost by Brian Suda and quickly applied the "Dopplr’s coloring algorithm" to some examples, and that this works is not in question. What is, is why? The process is as follows: ...
Eiriks's user avatar
  • 487
2 votes
1 answer
758 views

DrawLine method provides higher quality than DrawLines method

In my aplication I need to plot an equation. The plotted equation will be composed of many small linear lines. When I plot it using the DrawLine method inside a for I get higher quality than when ...
Ouranos's user avatar
  • 39
0 votes
1 answer
89 views

Open GL: convert pan size in screen to world size

I am implementing panning using two fingers in my ios 3D application. I have the translation value in screen coordinates (x,y). Now i need to move both the eye and center positions of the center in ...
Erik Sapir's user avatar
2 votes
1 answer
4k views

How to set repeating background image to a JPanel?

I want to set an image which repeats throughout the full width of the JPanel like we apply Background image to a DIV in CSS. How do I obtain that in swing for a JPanel?
Dilukshan Mahendra's user avatar
1 vote
2 answers
4k views

Changings Graphics drawString Color

I am trying to create a font from a ttf file and then render it as a certain colour to the screen using Graphics2D. The font loads fine and renders to the screen as the correct font, HOWEVER the ...
Brendan's user avatar
  • 67
1 vote
1 answer
2k views

Apply an iOS 7 style blur to a table view section header

I want to apply a blur effect, similar to what you see in the control center drag up, in the table section header of a table view. I have looked at some GitHub repos, like iOS-blur and LiveFrost, but ...
Andy Tsen's user avatar
  • 619
2 votes
1 answer
249 views

Using plot with title containing text, formulas and variables

I want to make the title of my plot contain text, formulas and variables. Consider the toy example where I want the title to read as: Histogram of normal distribution with (mu/sigma) equal to (value ...
Comp_Warrior's user avatar
2 votes
2 answers
910 views

Random mobile app icon generation algorithms [duplicate]

What is a suitable algorithm that can be used to generate random, but likely humanly distinguishable, graphic square icons? Icons, from 57x57 up to 1024 square, such as used for mobile apps, ...
hotpaw2's user avatar
  • 70.5k
0 votes
1 answer
477 views

Setting arc position in Java using Mouse

I am writing a 2D program. On my paintComponent I created an arc. public class Board extends Panel{ protected void paintComponent(Graphics g){ super.paintComponent(g); ...
Jonathan's user avatar
  • 545
2 votes
1 answer
3k views

Smooth out drawn lines (Pencil-like tool) java

if ((e != null && l.size() > 0) && (l != null)) { Graphics2D g2d = (Graphics2D) g; g2d.setStroke(new BasicStroke(2)); g2d.setRenderingHint(RenderingHints....
DakkVader's user avatar
  • 142
1 vote
1 answer
4k views

Swing repaint() doesn't work in loop or thread

I have the following code: import java.awt.Color; import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; ...
sidney's user avatar
  • 2,714
-1 votes
1 answer
99 views

setColor on void Paint()

I have a function to draw on JPanelu, but does not change my color. always displays the white squares . Method set.Color doesn't work. public void paint(Graphics g){ super.paint(g); ...
user3478498's user avatar
0 votes
0 answers
45 views

Image from programmatic screen capture different from external capture program

I've been temporarily using external programs (like Hypersnap) to capture areas on a form that have some high-chroma line graphics. That was intended as a temporary solution while the program took ...
StringTheoryNYC's user avatar
1 vote
1 answer
455 views

(R) How to put two motion plots together in R, and save them as a Gif file?

I'm doing a real recreation of the annual tree growth from tree-ring measurements, and I have many problems working with graphs and their margins. I have done the two graphs separately and these work ...
Darwin PC's user avatar
  • 901
0 votes
2 answers
4k views

Creating a visible grid in a JPanel

What I'm trying to do I want to create an API (personal one) that allows me to input a dimension (say 10x10) and it creates a visible grid with 10 squares by 10 squares, with the added 'feature' of ...
Eric's user avatar
  • 373
0 votes
1 answer
4k views

Trouble drawing point using Point2D.Double

I am attempting to read coordinates off a file and use them to draw points using this snippet of code: while(scan.hasNextLine()){ if(scan.next().equals("i")){ Point2D.Double point = new ...
Christian Baker's user avatar
6 votes
2 answers
173 views

Any downsides of moving from GDI+ to OpenGL?

I recently moved the rendering part of a program of mine from GDI+ to OpenGL. Now I'm wondering: are there any downsides to doing so? For example, are there any versions of Windows (XP or later) ...
user541686's user avatar
  • 208k
1 vote
1 answer
535 views

R ggplot: text & graphics below a plot with facet

I've created a plot of categorical data using facet in ggplot. Example script here: #script to produce plot with dummy data rm(list=ls(all=TRUE)) library(ggplot2) require(gridExtra) #put dummy ...
user3111174's user avatar
1 vote
2 answers
62 views

Button Alignment on Android

I am new at the android and I have an issue on button alignment I am trying to align some buttons but I cannot succeed the exact result I want. I will provide you an image on the result I want to ...
epapath's user avatar
  • 103
-1 votes
1 answer
442 views

how to call the method repaint() after a certain time

I want to renew the toolTip so i thought in using the repaint method , to repaint the frame every 30 seconds but it doesn't work . can someone helpme.. GrphicsTut Method import java.awt.Color; ...
aziz's user avatar
  • 13
1 vote
1 answer
2k views

How to fix blinking/flashing

Simple program that counts every time you click, however the image seems to blink/flash when clicked too fast. import java.awt.*; import java.awt.event.*; import java.awt.Graphics; import javax....
user3569802's user avatar
1 vote
1 answer
5k views

In Stata, how can I adjust size of coefplot's headings?

I'm working with coefplot command (source, docs) in Stata plotting regression coefficients. Taking the example from manual: sysuse auto,clear keep if rep78>=3 regress mpg headroom i.rep##i....
radek's user avatar
  • 7,310
0 votes
1 answer
94 views

3d picking from arbitrary viewpoint

I created a 3d scene of many pipes (valves,manhole) of different colors and materials . Now I want to use the mouse to pick them and get their attributes(color,material). I've tried to use ...
Leoxu's user avatar
  • 31
0 votes
1 answer
696 views

B-spline Curve ending and starting at origin?

I am generating a B-spline curve of degree 3 with 10 control points. My knot vector has 14 entries ranging from 0 to 1. For some reason my curve always begins and ends at the origin. It also fails ...
user2268884's user avatar
0 votes
0 answers
130 views

Select a shape in a set of shape on panel java

I draw multiple shapes on a panel, for example, I have a rectangle, a square and a triangle. Now I want to move one of these shape at a time. This means when I choose to move the rectangle, if it ...
Trung Bún's user avatar
  • 1,137
0 votes
1 answer
492 views

Draw Shapes by Dragging

I am newbie to Graphics Programming. I want to draw multiple shapes like Line, Rectangle and Oval by Dragging the mouse. I tried to accomplish this task but failed. My Output Looks like this. Here ...
Pankaj Jawale's user avatar
0 votes
1 answer
1k views

Java Graphics Updating Too Fast

I have searched the problem, but everyone seems to have problems with graphics updating too slow. To present my situation: I have a JFrame which I set to full screen, by using a compatible display ...
user3577465's user avatar
0 votes
0 answers
35 views

JApplet won't initialize if I call for graphics from another object

I'm attempting to simulate conway's game of life in a JApplet. I have a main class, called Gameboard, which extends JApplet and implements MouseListener. I also have another class, Grid, which creates ...
liable's user avatar
  • 93
1 vote
1 answer
481 views

How do you draw a rectangle based on mousemotion in pygame

I am attempting to create a paint program in pygame. It requires the user to be able to draw a rectangle on the screen by clicking and dragging. pygame.draw.rect(screeny, (255,255,255), [posi[0], posi[...
user3576467's user avatar
3 votes
2 answers
281 views

Graphics2D stroke spikes on Java

I'm having a problem with graphics 2d stroke, it seems no one has this problem since I have searched for something alike and no results. Here is the image. As you can see, there are spikes on my ...
xchan's user avatar
  • 37
2 votes
4 answers
125 views

Repainting Graphics Issue

I've been trying to write a small side-scroller game, but ran into an issue with repaint() not repainting. The key listener itself works, it increments and decrements the x and y values when the ...
Piinx's user avatar
  • 23
0 votes
1 answer
77 views

Detecting history of keystrokes in c#

So currently, I am a newb starting coding in c#. I started making a space game akin to space invaders and ran into an issue, in the draw method, I set it to draw my bullet and head upward on the ...
user3574878's user avatar
0 votes
1 answer
49 views

Graphics and applets

I am currently working on an assignment and need to create basic controls (buttons) for the Mandelbrot set that will operate as a JApplet. The graphics is initialised in the init() method and a method ...
user3574558's user avatar
0 votes
2 answers
932 views

Drawing oval in canvas using swing

I am new to Java and I have a problem with drawing an oval using paintComponent method. I found many similar threads, but none of the soultions worked. My code: RacerMain.java import javax.swing.*; ...
fragon's user avatar
  • 3,421
2 votes
1 answer
543 views

Streaming plots from R to Java without saving the plot

I am using Rcaller with Vaadin framework to make a program for running R-scripts from browser. One feature should be the ability to draw plots. This is not terribly difficult in itself, there are ways ...
Valtteri's user avatar
  • 463
0 votes
1 answer
2k views

Java - select shape in menu and draw in JPanel

I wanted to implement a menu in my JFrame where I can select which shape to draw. I have a class extending JFrame and a class extending JPanel: So in my frame I add the menu and the panel, simple as ...
The Condor's user avatar
  • 1,054
3 votes
1 answer
7k views

Kivy - [Critical] Warning too much iteration, when drawing Ellipse

I have been struggling recently creating a filled Circle in Kivy that stays a circle when the window is re-sized to a different width or height. I looked at the question here: Centering an object in ...
pech0rin's user avatar
  • 4,796
15 votes
3 answers
9k views

Copy R plot to clipboard with custom size

Is there a way to get R / RStudio to copy a plot to the clipboard with a custom size? RStudio has this function, but you have to define the size everytime and there is some extra clicking which I am ...
Jochen Döll's user avatar
1 vote
1 answer
11k views

Java Graphics "Bouncing Ball" Program

This is my first Graphical Java program and what I'm trying to do is re-create a simple classic program where I have multiple balls bouncing in a JFrame window. So far I have successfully been able ...
zoltack429's user avatar

1
227 228
229
230 231
423