antialiasing

Java Graphics2D floating point accurate drawOval alternative?

老子叫甜甜 提交于 2019-12-20 03:10:04
问题 So I am trying to draw an arc and put a circle around its round endpoint, but I am having issues due to rounding to the nearest pixel. This is visible in some but not all cases. Is there a way to draw circles using floating points and anti-aliasing to eliminate this rounding error? You can run this code to see the problem. I have drawn arcs of 0 length (appearing as large dots) instead of full arcs for clarity. import java.awt.*; import javax.swing.*; public class Example extends JFrame {

Is it possible to disable anti-aliasing in CSS when using @font-face with pixel fonts?

送分小仙女□ 提交于 2019-12-19 18:55:29
问题 I want to use a pixel font on the web. I'm including it using @font-face however all the browsers are applying anti-aliasing to the font. I can't seem to find a CSS rule to disable this, can anyone think of another method of disabling anti-aliasing? 回答1: Font rendering is done by the operating system and browser, so, as of yet, I believe there is little that you can do with CSS. There may be some proposed CSS rules in discussion (I've seen mention "font-smooth" or something like that), but

Howto Enable Font Antialiasing in Windows [closed]

若如初见. 提交于 2019-12-19 12:24:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have downloaded a font that looks less than desirable if it is not anti-aliased. I can not figure out how to enable anti-aliasing in VS, I have changed the 'Smooth Edges of Screen Fonts' in the system performance options but that does not seem to help. VS2008 on XP SP3. What am I missing? 回答1: Try using

UIImage's drawInrect: smoothes image

这一生的挚爱 提交于 2019-12-18 18:51:57
问题 I'm trying to draw image using UIImage 's drawInRect: method. Here is the code: UIImage *image = [UIImage imageNamed:@"OrangeBadge.png"]; UIGraphicsBeginImageContext(image.size); [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); The problem is that the resulting image is blurry. Here is the resulting image (on the right side) compared to the source image (on the left side):

Maintaining fixed-thickness lines in WPF with Viewbox scaling/stretching

会有一股神秘感。 提交于 2019-12-18 13:28:44
问题 I have a <Grid> which contains some vertical and horizontal <Line> s. I want the grid to be scalable with the window size, and retain its aspect ratio, so it's contained in a <Viewbox Stretch="Uniform"> . However, I also want the lines to always render with a width of 1 pixel, so I use: Line line = new Line(); line.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased); // other line settings here... This makes the lines' initial appearance ideal, but as soon as you start resizing the

Quality of Three.js shadow in Chrome/MacOS?

跟風遠走 提交于 2019-12-18 12:24:04
问题 I am experimenting with a simple Three.js scene (novice in this area). I am using the Three.js WebGLRenderer and have set up a plane, a cube that casts shadows and a directional light source. The result is shown in the image. How do I: 1. Increase the quality of the shadow rendering? 2. Get rid of the jagged edges? I have set the antialiasing to true but it does not seem to help in any browser ... renderer = new THREE.WebGLRenderer({ antialias: true}); 回答1: You can do two things. First set a

Can I draw with antialiasing on canvas?

半城伤御伤魂 提交于 2019-12-18 11:38:30
问题 Can I draw with anti-aliasing on canvas? I need my circles and line have smooth edges. 回答1: Drawing operations want Paint . In this Paint you set Paint.setFlags(Paint.ANTI_ALIAS_FLAG) 回答2: Check this out. It fairly uses smooth edges.. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html The paint properties needed to get anti-aliasing is : mPaint = new Paint(); mPaint.setAntiAlias(true); For drawing use: mPath = new Path(); mPath.reset

UIImage ScaleToFit disable antialias?

纵然是瞬间 提交于 2019-12-17 22:16:07
问题 is there any way to disable antialiasing when scaling images in uiimage? thanks 回答1: Add the QuartzCore framework to your project, then set the image view’s layer ’s magnificationFilter property to kCAFilterNearest . 回答2: I was working with SpriteKit in Xcode 11 (Swift 5) and also got this problem. To solve it (i.e. disable anti-aliasing) i did the following: texture?.filteringMode = SKTextureFilteringMode.nearest 来源: https://stackoverflow.com/questions/6092167/uiimage-scaletofit-disable

Draw smoothly scaled bitmaps on Canvas

霸气de小男生 提交于 2019-12-17 21:48:30
问题 This is how I draw Bitmap on Canvas in my Android app: canvas.save(); canvas.scale(scale, scale, x, y); canvas.drawBitmap(bitmap, x, y, null); canvas.restore(); However the Bitmap is not scaled smoothly, no anti-aliasing is performed. How can I enable anti-aliasing? 回答1: Try this: Paint paint = new Paint(); paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true); canvas.drawBitmap(bitmap, x, y, paint); 回答2: Both Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG); or paint

how to make JTextPane paint anti-aliased font?

霸气de小男生 提交于 2019-12-17 21:29:04
问题 in the a swing app i'm rendering text with a custom JComponent , using Graphics.drawString() . here is a sample: aa text http://img525.imageshack.us/img525/4928/drawstringsample.jpg in that same app, i'm rendering text using a JTextPane . here is a sample: alt text http://img28.imageshack.us/img28/1134/jtextpanesample.jpg can you notice how the lower sample is a little 'smudged'? well, i can't figure out how to make it look like the upper sample. thanks, asaf :-) update: System.setProperty(