antialiasing

Anti-alias diagonal edges of CALayer

二次信任 提交于 2019-11-30 03:59:41
When I set the transform property of my CALayer with a CATransform3DRotate, the layer is properly rotated. However, the edges of the layer are jagged and not anti-aliased. I've read a couple posts on the subject: iPhone: CALayer + rotate in 3D + antialias? iPhone - Jagged Edges when applying perspective to CALayer I've tried to incorporate their advice by setting the following properties on my diagonal layer CALayer* layer = myView.layer; layer.shadowOpacity = 0.01; layer.edgeAntialiasingMask = kCALayerTopEdge | kCALayerBottomEdge | kCALayerRightEdge | kCALayerLeftEdge; layer.borderWidth = 1.0

Dynamically turn on/off antialiasing and shadows in WebGLRenderer

有些话、适合烂在心里 提交于 2019-11-29 17:56:11
How can I dynamically turn on and off antialiasing and shadows in WebGLRenderer? Simply changing the properties of anti-aliasing and shadowMapEnable does not work. I looked in the source and found a method updateShadowMap () but it was removed in release 69. UPDATE: OK, the answer to the second half of the question I found here https://github.com/mrdoob/three.js/issues/2466 As a result the following code works fine: renderer.shadowMapEnabled = false; for(var i in tiles.children) tiles.children[i].material.needsUpdate=true; renderer.clearTarget( sun.shadowMap ); You can't enable/diable

Drawing line less than one pixel thick requires anti-aliasing in Android 4.2

 ̄綄美尐妖づ 提交于 2019-11-29 16:12:09
I'm trying to draw a very thin line (less than one pixel thick) in android. I'm using Paint blackThin = new Paint(); blackThin.setStrokeWidth(0.1f); blackThin.setColor(Color.BLACK); to initialize the paint object. This works fine in Android 2.2, but when I try it in 4.2 (also 4.1, I think - I tested that one briefly - I haven't tested any other versions other that 2.2, 4.1.2 and 4.2) the lines won't show up when I draw them. To make them show up in 4.2, it seems like I have to set the anti-aliasing flag to be true. (I tried that, and the lines showed up.) But I really don't want that, because

Draw emf antialiased

那年仲夏 提交于 2019-11-29 14:30:37
问题 Is there a way to draw an emf metafile (exported form a drawing tool) with antialiasing enabled? The tools I tried are not capable of exporting emf files antaliased so I wondered if I can turn it back on manually when drawing the emf in the OnPaint override of my Controls. If anyone can confirm that is technically possible to generate antialiased emf files, another solution would be to use a drawing tool that can export to antialiased emf or have a 3rd party converter do this later. If anyone

Drawing scaled bitmaps on a SurfaceView — no antialiasing

£可爱£侵袭症+ 提交于 2019-11-29 07:49:31
I'm sorry if this topic has been brought before, but all my searches on the web and google groups did not help me. I'm currently developing a little game with the Android SDK, and use hi-res bitmaps that I resize accordingly to match the device's resolution (letting the system do it for me is not "crisp" enough). I use a SurfaceView, on which I paint in one pass a canvas filling the whole surface. The paint uses setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)) to allow masking. Beforehand, I retrieve various bitmaps -- which are resized at initialization with createScaledBitmap()

Why are the Tkinter canvas lines jagged?

给你一囗甜甜゛ 提交于 2019-11-29 06:52:19
The lines drawn on a Tkinter.Canvas are not smooth. How can they be made smooth? Here's what I tried: from Tkinter import * root = Tk() cv = Canvas(root,bg = 'white') rt1 = cv.create_rectangle(10,10,110,110,width = 8,tags = ('r1','r2','r3')) def printRect(event): print 'rectangle' def printLine(event): print 'line' cv.tag_bind('r1','<Button-1>',printRect) cv.tag_bind('r1','<Button-3>',printLine) cv.create_line(10,20,200,200,width = 5,tags = 'r1') cv.pack() root.mainloop() Here's what it looks like: tkinter graphics are not anti-aliased which is why the diagonal line appears jagged. There may

Disable antialiasing inside Xcode?

半城伤御伤魂 提交于 2019-11-29 06:23:04
How does one disable antialiasing inside the code editor in Xcode, but not system-wide? Evan For Xcode 3.x the necessary terminal command is: defaults write com.apple.xcode AppleAntiAliasingThreshold <some integer value> For Xcode 4 & 5 it is: defaults write com.apple.dt.Xcode AppleAntiAliasingThreshold <some integer value> For Xcode 6 you may first need to enter the following at a terminal console: defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled YES Then, as per usual: defaults write com.apple.dt.Xcode AppleAntiAliasingThreshold <some integer value> Using

Anti-alias diagonal edges of CALayer

六眼飞鱼酱① 提交于 2019-11-29 01:09:47
问题 When I set the transform property of my CALayer with a CATransform3DRotate, the layer is properly rotated. However, the edges of the layer are jagged and not anti-aliased. I've read a couple posts on the subject: iPhone: CALayer + rotate in 3D + antialias? iPhone - Jagged Edges when applying perspective to CALayer I've tried to incorporate their advice by setting the following properties on my diagonal layer CALayer* layer = myView.layer; layer.shadowOpacity = 0.01; layer.edgeAntialiasingMask

Antialiasing edges of UIView after transformation using CALayer's transform

对着背影说爱祢 提交于 2019-11-28 16:43:54
I have a UIView object that rotates using CALayer 's transform: // Create uiview object. UIImageView *block = [[UIImageView alloc] initWithFrame....] // Apply rotation. CATransform3D basicTrans = CATransform3DIdentity; basicTrans.m34 = 1.0/-distance; blockImage.layer.transform = CATransform3DRotate(basicTrans, rangle, 1.0f, 0.0f, 0.0f); After rotating the edges of the object are not antialiasing. I need to antialias them. Help me, please. How can it be done? One way to do this is by placing the image inside another view that's 5 pixels bigger. The bigger view should have a transparent

Draw smoothly scaled bitmaps on Canvas

五迷三道 提交于 2019-11-28 16:32:36
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? Try this: Paint paint = new Paint(); paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true); canvas.drawBitmap(bitmap, x, y, paint); Sileria Both Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG); or paint.setFilterBitmap(true); worked for me but be very careful, on my game it cut down the FPS from 30FPS to