subpixel

Drawing an image using sub-pixel level accuracy using Graphics2D

て烟熏妆下的殇ゞ 提交于 2020-08-22 11:48:11
问题 I am currently attempting to draw images on the screen at a regular rate like in a video game. Unfortunately, because of the rate at which the image is moving, some frames are identical because the image has not yet moved a full pixel. Is there a way to provide float values to Graphics2D for on-screen position to draw the image, rather than int values? Initially here is what I had done: BufferedImage srcImage = sprite.getImage ( ); Position imagePosition = ... ; //Defined elsewhere g

Is there any way to draw lines with subpixel precision in Swing?

Deadly 提交于 2019-12-19 05:43:28
问题 This question has been asked before, but the answers don't solve the problem, so I ask it again. It was suggested that instead of using g2.drawLine , you could use g2.draw(line) , where line is a Line2D.Double . However, as you can see from the screenshot, the lines are still drawn as if they ended on an integer pixel (each set of 10 lines is exactly parallel). import javax.swing.*; import java.awt.*; import java.awt.geom.Line2D; public class FrameTestBase extends JFrame { public static void

Is there any way to draw lines with subpixel precision in Swing?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 05:43:09
问题 This question has been asked before, but the answers don't solve the problem, so I ask it again. It was suggested that instead of using g2.drawLine , you could use g2.draw(line) , where line is a Line2D.Double . However, as you can see from the screenshot, the lines are still drawn as if they ended on an integer pixel (each set of 10 lines is exactly parallel). import javax.swing.*; import java.awt.*; import java.awt.geom.Line2D; public class FrameTestBase extends JFrame { public static void

HTML: Sub-pixel border

↘锁芯ラ 提交于 2019-12-17 20:35:32
问题 Is it possible to have a border that is thinner than 1px and works in IE6+ and is not an image and renders properly visually? Thank you. 回答1: I think you could define the width of a border using units like em which would come out to less than 1px, and it would be valid. However, like Will Martin said, for display purposes it would just round it up or down to a whole pixel. 回答2: Edit: I have overseen then IE6 restriction, but I leave the answer here for others ... Its possible with transform

IE 11 sub-pixel rendering overflow

主宰稳场 提交于 2019-12-14 02:34:37
问题 On Internet Explorer 11, I have an issue with sub-pixel rendering causing an overflow of an element. As you can see, on IE11, the red part of the gauge seems to be "peeking" out of the bottom, while it seems fine on the other 2 major browsers Chrome and FireFox. If we zoom in on the issue in IE, we can see what's happening: It seems to be rendering a sub-pixel over the mask. The header "Temperature" renders as an element with the height of 34.5px, causing all elements underneath it to be

SIFT Taylor Expansion working out subpixel locations

杀马特。学长 韩版系。学妹 提交于 2019-12-07 12:06:49
问题 I am trying to implement SIFT and am currently just trying to understand how it works before starting to implement it in MATLAB, i understand most of it except how to work out subpixel accuracy using Taylor Expansion: Above is the equation from the original paper. I have a few question on how it is applied. Are the derivatives worked out in each dimension seperatly and then the equation applied to x then y? Are the first and second derivates applied along the sigma axis aswell? I have tired

Bad character spacing (kerning) in JavaFX's font rendering (in Linux)

被刻印的时光 ゝ 提交于 2019-12-06 03:56:03
问题 I've started developing an application in JavaFX and I've run in an issue, I could find very little helpful information about: The spacing of between characters in Linux is very uneven. I'm not talking about the width of different characters but of the spaces between the characters. It's visible in normal text, but the following example illustrates the effect better than normal text. Take a look at the first row. The space between the first two characters is smaller than between the second

SIFT Taylor Expansion working out subpixel locations

走远了吗. 提交于 2019-12-06 01:16:44
I am trying to implement SIFT and am currently just trying to understand how it works before starting to implement it in MATLAB, i understand most of it except how to work out subpixel accuracy using Taylor Expansion: Above is the equation from the original paper. I have a few question on how it is applied. Are the derivatives worked out in each dimension seperatly and then the equation applied to x then y? Are the first and second derivates applied along the sigma axis aswell? I have tired looking at previous implementations but cannot seam to find where they do this. Thanks in advance Faroq

Java - Does subpixel line accuracy require an AffineTransform?

南笙酒味 提交于 2019-12-04 10:41:46
问题 I've never worked with Java drawing methods before, so I decided to dive in and create an analog clock as a PoC. In addition to the hands, I draw a clock face that includes tick marks for minutes/hours. I use simple sin/cos calculations to determine the position of the lines around the circle. However, I've noticed that since the minute tick-marks are very short, the angle of the lines looks wrong. I'm certain this is because both Graphics2D.drawLine() and Line2D.double() methods cannot draw

Bad character spacing (kerning) in JavaFX's font rendering (in Linux)

久未见 提交于 2019-12-04 08:49:24
I've started developing an application in JavaFX and I've run in an issue, I could find very little helpful information about: The spacing of between characters in Linux is very uneven. I'm not talking about the width of different characters but of the spaces between the characters. It's visible in normal text, but the following example illustrates the effect better than normal text. Take a look at the first row. The space between the first two characters is smaller than between the second and third. This also happens between the sixth and seventh character and several others: Swing does not