antialiasing

OpenGL ES iPhone - drawing anti aliased lines

被刻印的时光 ゝ 提交于 2019-11-26 06:13:05
问题 Normally, you\'d use something like: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); glLineWidth(2.0f); glVertexPointer(2, GL_FLOAT, 0, points); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_LINE_STRIP, 0, num_points); glDisableClientState(GL_VERTEX_ARRAY); It looks good in the iPhone simulator, but on the iPhone the lines get extremely thin and w/o any anti aliasing. How do you get AA on iPhone? 回答1: One can achieve the effect of anti

HTML5 Canvas and Anti-aliasing

喜你入骨 提交于 2019-11-26 06:06:21
问题 How to turn on the anti-aliasing on an canvas . The following code doesn\'t draw a smooth line: var context = mainCanv.getContext(\"2d\"); if (context) { context.moveTo(0,0); context.lineTo(100,75); context.strokeStyle = \"#df4b26\"; context.lineWidth = 3; context.stroke(); } 回答1: Anti-aliasing cannot be turned on or off, and is controlled by the browser. Can I turn off antialiasing on an HTML <canvas> element? 回答2: You may translate canvas by half-pixel distance. ctx.translate(0.5, 0.5);

3D CSS transform, jagged edges in Firefox

不羁的心 提交于 2019-11-26 06:04:59
问题 Similary to \"css transform, jagged edges in chrome\", same occurs with Firefox on 3D transforms, eg: http://jsfiddle.net/78d8K/5/ (<- remember: Firefox ) This time, backface-visibility doesn\'t help :( Any idea? 回答1: Edited answer: (after comments) "Workaround", add a transparent outline attribute: outline: 1px solid transparent; Tested on Firefox 10.0.2 Windows 7: http://jsfiddle.net/nKhr8/ Original answer: (background-color dependent) "Workaround", add a border attribute with the same

Any quick and dirty anti-aliasing techniques for a rotated UIImageView?

丶灬走出姿态 提交于 2019-11-26 05:58:26
问题 I\'ve got a UIImageView (full frame and rectangular) that i\'m rotating with a CGAffineTransform. The UIImage of the UIImageView fills the entire frame. When the image is rotated and drawn the edges appear noticeably jagged. Is there anything I can do to make it look better? It\'s clearly not being anti-aliased with the background. 回答1: Remember to set the appropriate anti-alias options: CGContextSetAllowsAntialiasing(theContext, true); CGContextSetShouldAntialias(theContext, true); 回答2: The

Java Text on Image

岁酱吖の 提交于 2019-11-26 05:54:28
问题 I am loading an image in bufferedimage and then writing some text on it .After I add text it makes image blurry and text distorted. I have TEXT ANTIALIASING ON . It can be seen as attached. 回答1: You should be able to control the text quality with the rendering hints that are shown in the other responses. I know that it works because I have done it a lot, so I think it must be something else that causes the quality degradation in this case. How do you check the image quality? Do you paint the

Disable antialising when scaling images [duplicate]

帅比萌擦擦* 提交于 2019-11-26 05:24:56
问题 Possible Duplicate: How to stretch images with no antialiasing Is it in any way possible to disable antialiasing when scaling up an image ? Right now, i get something that looks like this : Using the following css code : #bib { width:104px;height:104px;background-image:url(/media/buttonart_back.png);background-size:1132px 1360px; background-repeat:no-repeat;} What I would like, is something like this : In short, any CSS flag to disable anti-aliasing from when scaling up images, preserving

Java2D Graphics anti-aliased

拟墨画扇 提交于 2019-11-26 03:59:31
问题 I am new to Java and trying to use Java2D Graphics to create a Image. But the output is coming as anti-aliased. I tried many ways to rectify it but doesn\'t work. The characters are getting distorted or jagged. public BufferedImage createNameOnButton(String label) { int messageWidth = 0; Font font = new Font(\"Arial\", Font.PLAIN, 11); BufferedImage bi = new BufferedImage( 10, 10, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = (Graphics2D) bi.getGraphics(); g2d.setRenderingHint( RenderingHints

css transform, jagged edges in chrome

你说的曾经没有我的故事 提交于 2019-11-26 01:36:55
问题 I\'ve been using CSS3 transform to rotate images and textboxes with borders in my website. The problem is that the border look jagged in Chrome, like a (low-resolution) game without Anti-Aliasing. In IE, Opera and FF it looks much better because AA is used (which is still clearly visible but not that bad). I can\'t test Safari because I don\'t own a Mac. The rotated photo and text itself look fine, it is only the border that looks jagged. The CSS I use is this: .rotate2deg { transform: rotate

Can I turn off antialiasing on an HTML <canvas> element?

≡放荡痞女 提交于 2019-11-26 00:54:18
问题 I\'m playing around with the <canvas> element, drawing lines and such. I\'ve noticed that my diagonal lines are antialiased. I\'d prefer the jaggy look for what I\'m doing - is there any way of turning this feature off? 回答1: For images there's now context.imageSmoothingEnabled = false . However, there's nothing that explicitly controls line drawing. You may need to draw your own lines (the hard way) using getImageData and putImageData . 回答2: Draw your 1-pixel lines on coordinates like ctx

Html5 canvas drawImage: how to apply antialiasing

喜欢而已 提交于 2019-11-25 23:37:12
问题 Please have a look at the following example: http://jsfiddle.net/MLGr4/47/ var canvas = document.getElementById(\"canvas\"); var ctx = canvas.getContext(\"2d\"); img = new Image(); img.onload = function(){ canvas.width = 400; canvas.height = 150; ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, 400, 150); } img.src = \"http://openwalls.com/image/1734/colored_lines_on_blue_background_1920x1200.jpg\"; As you see, the image is not anti-aliased although it is said that drawImage applies anti