graphics

Selecting proper toolkit for a 2D simulation project in Java

十年热恋 提交于 2020-01-15 06:18:33
问题 I am looking for a toolkit that will allow me to design widgets containing 2D graphics for an elevator simulation in Java. Once created, those widgets will be integrated with SWT, Swing, or QtJambi framework. Background information: I am developing an Elevator Simulator for fun. My main goal is to increase my knowledge of Java, Eclipse IDE, and more importantly concurrency. It is certainly fun and I enjoyed implementing this State Machine Pattern. Anyway, I am at a point where I would like to

How to efficiently write pixels to the screen with Direct2D

萝らか妹 提交于 2020-01-15 04:01:05
问题 I have a array of pixels (m_pixels) that I want to render to the screen using Direct2D. The array contains 10,000 elements (100 rows of 100 pixels). The code below loops over the pixels and draws them to the screen as 10x10 rectangles. Is there a more efficient way of performing this operation? How can I add a GaussianBlur effect to the pixels/image? m_d2dContext->BeginDraw(); m_d2dContext->Clear(ColorF(0.0f, 0.0f, 0.0f)); // Render m_pixels // m_pixels is updated by the solver directly

Antialiased composition by coverage?

时间秒杀一切 提交于 2020-01-15 03:04:07
问题 Does anyone know of a graphics system which handles composition of multiple anti-aliased lines well? I'm showing a dependency diagram and have a bunch of curves emanating from a point. These are drawn anti-aliased in the usual way, of blending partially covered pixels. So if two lines would occupy the same half of a pixel, the antialiasing blends it to 75% filled rather than 50% filled. With enough lines drawn on top of each other, the pixel blend clamps and you end up with aliased lines. I

Antialiased composition by coverage?

时光总嘲笑我的痴心妄想 提交于 2020-01-15 03:03:00
问题 Does anyone know of a graphics system which handles composition of multiple anti-aliased lines well? I'm showing a dependency diagram and have a bunch of curves emanating from a point. These are drawn anti-aliased in the usual way, of blending partially covered pixels. So if two lines would occupy the same half of a pixel, the antialiasing blends it to 75% filled rather than 50% filled. With enough lines drawn on top of each other, the pixel blend clamps and you end up with aliased lines. I

Kivy - windows - Unable to find any valuable Window provider at all

匆匆过客 提交于 2020-01-15 02:46:52
问题 I am starting with kivy. here is the sample code I am running. import kivy from kivy.app import App from kivy.uix.button import Label kivy.require('1.9.0') class HelloApp(App): def build(self): return Label(text='Hello World!') if __name__ == "__main__": HelloApp().run() and here is the traceback I am getting: [INFO ] [Logger ] Record log in C:\Users\monac\.kivy\logs\kivy_16-11-23_9.txt [INFO ] [Kivy ] v1.9.1 [INFO ] [Python ] v3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64

Kivy - windows - Unable to find any valuable Window provider at all

試著忘記壹切 提交于 2020-01-15 02:46:25
问题 I am starting with kivy. here is the sample code I am running. import kivy from kivy.app import App from kivy.uix.button import Label kivy.require('1.9.0') class HelloApp(App): def build(self): return Label(text='Hello World!') if __name__ == "__main__": HelloApp().run() and here is the traceback I am getting: [INFO ] [Logger ] Record log in C:\Users\monac\.kivy\logs\kivy_16-11-23_9.txt [INFO ] [Kivy ] v1.9.1 [INFO ] [Python ] v3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64

Paint in JFrame not working (Java)

爷,独闯天下 提交于 2020-01-14 10:42:10
问题 So in class we are making a Java program. We are trying to use the paint(Graphics g) function in the JFrame. We have tried it in the past (weeks ago) and it used to work. But now it doesnt (or we made a mistake somewhere). We have also tried to use paintComponent(Graphics g) but nothing seems to work. Here is our code: public class MainAc { public static void main(String[] args) { JFrame frame = new JFrame("Class Paint"); JButton button = new JButton("Click for more"); frame.setSize(800, 600)

Paint in JFrame not working (Java)

為{幸葍}努か 提交于 2020-01-14 10:41:40
问题 So in class we are making a Java program. We are trying to use the paint(Graphics g) function in the JFrame. We have tried it in the past (weeks ago) and it used to work. But now it doesnt (or we made a mistake somewhere). We have also tried to use paintComponent(Graphics g) but nothing seems to work. Here is our code: public class MainAc { public static void main(String[] args) { JFrame frame = new JFrame("Class Paint"); JButton button = new JButton("Click for more"); frame.setSize(800, 600)

What is the best way to build a Minesweeper Board in a JFrame?

拜拜、爱过 提交于 2020-01-14 07:02:47
问题 I am just trying to construct a gameboard with tiles to work with. I got it to work by painting the tile into rows and columns with BufferedImage, but I am going to need to constantly update the GUI as the game is played. So I tried to add the tile image to an ImageIcon, then to a JLabel array so that I could set the position. After that I would add the labels to the gui JPanel, but they had these default gaps between them. Am I approaching this incorrectly? I am very new to Swing and Java

What is the best way to build a Minesweeper Board in a JFrame?

China☆狼群 提交于 2020-01-14 07:02:29
问题 I am just trying to construct a gameboard with tiles to work with. I got it to work by painting the tile into rows and columns with BufferedImage, but I am going to need to constantly update the GUI as the game is played. So I tried to add the tile image to an ImageIcon, then to a JLabel array so that I could set the position. After that I would add the labels to the gui JPanel, but they had these default gaps between them. Am I approaching this incorrectly? I am very new to Swing and Java