graphics

How to improve graphics quality

£可爱£侵袭症+ 提交于 2020-07-23 06:46:14
问题 First look at the difference: The top's been created in WPF and the bottom with Qt. All Path Data has been taken from materialdesignicons. For WPF I've taken XAML and for QtQuick SVG . For DropShadow I've specified a value for samples property BUT for svg and rotated Text there's no such property. Is this the difference between OpenGL/CL/etc. and DirectX or something else? The machine I'm working on has both Intel and NVIDIA! I want my QtQuick app to use NVIDIA to compute efficiently and

Fill the area with uniform spacing

。_饼干妹妹 提交于 2020-07-22 05:47:07
问题 User Requiremnts Inputs User will give boundary points of the closed polygon P in which he wants to fill the area formed by polygon. Red Points P in the Examples. Space S in between the lines. Spacing S between the lines of Green points in Examples. Output The output will be a closed polygon points. Green G points in the Examples. Can someone help me, i don't know which algorithm to use. 回答1: The example looks like it was created like this: Create a field of hexagonally packed spots with the

Zoom and translate an Image from the mouse location

此生再无相见时 提交于 2020-07-07 07:21:08
问题 Issue: Attempting to zoom (scale) an Image from (or at the) mouse location using transforms in the Paint event to translate bitmap origin to mouse location, then scale the Image and translate its origin back. The Image jumps and fails to scale from the relocated origin when translating the mouse location. Rotate, scale, and pan function correctly without translating to the the mouse location. Running on .Net 4.7.2, using Visual Studio in Windows 10 1909 v18363.778 The relevant code blocks:

Reverse (remove) anti-aliasing filter

China☆狼群 提交于 2020-07-05 03:44:43
问题 I have a set of anti-aliased greyscale PNG images. I need to know how to programatically revert the anti-aliasing effect and get sharp edges again. I'm using GDI+ but I am less interested in code. I need an algorithm, maybe a convolution filter, if such a matrix can be built. The greyscale images (should) contain only 6 colors (or different shades of grey). This is so that later on I can re-color them using a Color-Lookup filter. However, when the images where saved, Photoshop automatically

How do I make a glass window?

一世执手 提交于 2020-06-29 03:56:06
问题 My goal is to create a glass window. I don't know if it has another name, but I'll try to describe precisely what I want to archive. This window would be empty (full transparency), at the foreground, and the user could click through and do his stuff like always. Like a literal glass between the screen and the user. My final goal is make that old prank where someone get surprised by a image flashing out of nowhere. I looked upon SFML, QT, Pygame, some Java things, but couldn't find a way. I

Creating graphics for euclidean instances of TSP

*爱你&永不变心* 提交于 2020-06-28 05:48:06
问题 I'm currently working on research centring around the Travelling Salesman Problem. More precisely I'm working with sample data using the EUC_2D edge weight type. Like the following: 1 11003.611100 42102.500000 2 11108.611100 42373.888900 3 11133.333300 42885.833300 I am able to produce a tour order. For example, 2-3-1. I'd like to be able to create some simple graphics which represent a point set for a given problem, and then a point set with a tour over the top. Could anyone recommend a

Wrong color when using CopyRect to copy from large image to smaller canvas

余生长醉 提交于 2020-06-28 05:23:55
问题 I was writing a function to shrink a source image (JPG file) according to a 170 x 200px picture. The source JPG image was loaded into a TImage (Image1, fixed size of 400 x 400px, stretched to fit with aspect ration maintained), then the user will make a selection rectangle to set the area to copy, and then the image will be copied using CopyRect() onto the destination TImage (Image2). void __fastcall TSizePhotoForm::Button3Click(TObject *Sender) { float scale, base = 400.0f; TRect crect; //

Only 1 Corner is Rounded when I call fillRoundRect()

自古美人都是妖i 提交于 2020-06-27 15:31:07
问题 When run this code: import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import javax.swing.JButton; import javax.swing.JLabel; public class CustomButton extends JButton { int width = 100; int height = 50; int radius = 10; JLabel lab; @Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setColor(Color.ORANGE); g2

My text in my clock python is not aligning properly

不羁岁月 提交于 2020-06-27 04:08:06
问题 My text in my turtle module is not aligning properly, it is aligned up and to the left. I want it to align exactly where the turtle is. Can anyone help? I tried setting the xcor and ycor of the turtle up and to the left by 5 units and that did not work. Any help would be greatly appreciated. Code: import time from datetime import datetime,date import turtle t = turtle.Pen() while True: turtle.tracer(0, 0) hour_hand = float(datetime.today().hour) minute_hand = float(datetime.today().minute)

How to make a CSS animation/transition play at a fixed speed, not a fixed duration? [duplicate]

我只是一个虾纸丫 提交于 2020-06-27 03:57:10
问题 This question already has answers here : Set CSS transition to use speed instead of duration? (3 answers) Closed 3 years ago . I have a CSS animation that makes an element move an undefined distance in a straight line. Animations have fixed durations, as far as I know, so the animation always takes the same amount of time to run, no matter how far the element has to move. How do I make it so the animation doesn't have a fixed duration , but a fixed movement speed ? I want something like "X