antialiasing

iOS: Antialiasing fail (PNG in CALayer)

丶灬走出姿态 提交于 2019-12-04 13:36:45
I'm attempting to draw this image on screen: This is the code: CALayer* dullLayer = [CALayer layer]; { dullLayer.frame = CGRectMake(0,0,BUTTON_SIZE,BUTTON_SIZE); dullLayer.position = CGPointFromPoint2D( btnCenter ); dullLayer.opacity = topQuadrant ? 1.0 : 0.5; [wheelLayer addSublayer: dullLayer]; } UIImage* test = [UIImage imageNamed: @"OuterButton_Dull.png"]; dullLayer.contents = (id) [test CGImage]; This is what I get: What gives? Why are the edges so jagged? Contrast this with the Roman numeral images that have been composited to screen in exactly the same way. I have tried dullLayer

ANTI_ALIAS_FLAG for ImageView within layout?

江枫思渺然 提交于 2019-12-04 03:24:14
Does anyone know how to apply the ANTI_ALIAS_FLAG to ImageView 's in layouts rather than in Java? You want to apply the attribute android:antialias="true" , like so: <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:antialias="true" /> 2013-year-way: declare special xml resource describing ImageView's content. For example we want an ImageView to contain antialiased Bitmap. So we need to write somethig like this: <bitmap xmlns:android="http://schemas.android.com/apk/res

Problem with poor font rendering with CSS3 transitions, jQuery, & Google Fonts

血红的双手。 提交于 2019-12-03 13:46:28
In Firefox, there is no problem. Here's an image: http://cl.ly/3R0L1q3P1r11040e3T1i In Safari, the text is rendering poorly: http://cl.ly/0a1101341r2E1D2d1W46 In IE7 & IE8, it's much worse, but I don't have a picture. Sorry :( I'm using Isotope jQuery plugin, and the CSS3 transitions seem to cause the poor font-rendering. I'm also using Google Font API. Here's what the CSS transitions for Isotope are written as: /**** Isotope CSS3 transitions ****/ .isotope, .isotope .isotope-item { -webkit-transition-duration: 0.8s; -moz-transition-duration: 0.8s; transition-duration: 0.8s; } .isotope {

Pygame draw anti-aliased thick line

折月煮酒 提交于 2019-12-03 12:46:14
I used to draw lines (given some start and end points) at pygame like this: pygame.draw.line(window, color_L1, X0, X1, 2) , where 2 was defining the thickness of the line. As, anti-aliasing is not supported by .draw , so I moved to .gfxdraw and pygame.gfxdraw.line(window, X0[0], X0[1], X1[0], X1[1], color_L1) . However, this does not allow me to define the thickness of the line. How could I have thickness and anti-aliasing together? After many trials and errors, the optimal way to do it would be the following: 1) First, we define the center of the shape given the X0_{x,y} start and X1_{x,y}

How to draw anti aliased lines in OpenGL ES 2.0?

丶灬走出姿态 提交于 2019-12-03 10:58:38
问题 I am trying to draw some contours that I have stored as vertex arrays: typedef struct { float* vertices; int nrPoints; }VertexCurve; list<VertexCurve> CurveList; I am using some samples from an opengl es 2.0 book : http://opengles-book.com/ The drawing method looks like this: void Draw ( ESContext *esContext ) { UserData *userData = (UserData*)esContext->userData; // Set the viewport glViewport ( 0, 0, esContext->width, esContext->height ); // Clear the color buffer glClear ( GL_COLOR_BUFFER

Add shadow (recessed text effect) to Cocoa label without degrading text rendering quality

核能气质少年 提交于 2019-12-03 05:08:49
问题 I'd like to create statusbar with text effect like in Safari or iTunes, i.e. recessed text. However, if I simply add shadow in Interface Builder using Core Animation panel, OS X's worst text rendering kicks in: What's the trick to get recessed text on a label and keep proper subpixel rendering? 回答1: There is a built-in way to do this: [[yourTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; 回答2: It's a cheap old trick: You draw the text in white at an offset and then draw the black

How to antialias SVG text in Firefox

拈花ヽ惹草 提交于 2019-12-03 03:20:16
Does anyone know the best way to anti-alias svg text that will work in Firefox? I tried text-antialias:true but this has no effect, and also I tried using a stroke paint but this just thickens up the font and is not what I like. Example: <!DOCTYPE html> <html> <body> <svg height="100" width="500"> <text y="50" x="250" text-anchor="middle" style="font-size: 40px" >Hello</text> </svg> </body> </html> I have uploaded this to http://jsfiddle.net/KJhrY/ This example appears antialiased in IE9 on my PC (Windows) Firefox 25 will have support for the mox-osx-font-smoothing attribute! So for firefox 25

How to draw anti aliased lines in OpenGL ES 2.0?

我与影子孤独终老i 提交于 2019-12-03 00:32:46
I am trying to draw some contours that I have stored as vertex arrays: typedef struct { float* vertices; int nrPoints; }VertexCurve; list<VertexCurve> CurveList; I am using some samples from an opengl es 2.0 book : http://opengles-book.com/ The drawing method looks like this: void Draw ( ESContext *esContext ) { UserData *userData = (UserData*)esContext->userData; // Set the viewport glViewport ( 0, 0, esContext->width, esContext->height ); // Clear the color buffer glClear ( GL_COLOR_BUFFER_BIT ); // Use the program object glUseProgram ( userData->programObject ); //glEnable(GL_SAMPLE_ALPHA

Add shadow (recessed text effect) to Cocoa label without degrading text rendering quality

二次信任 提交于 2019-12-02 18:24:02
I'd like to create statusbar with text effect like in Safari or iTunes, i.e. recessed text. However, if I simply add shadow in Interface Builder using Core Animation panel, OS X's worst text rendering kicks in: What's the trick to get recessed text on a label and keep proper subpixel rendering? There is a built-in way to do this: [[yourTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; It's a cheap old trick: You draw the text in white at an offset and then draw the black text on top of it. There is a hook for shadows in the text-drawing system, NSAttributedString's

Why are artifacts visible in a scaled html5 canvas?

ぐ巨炮叔叔 提交于 2019-12-02 18:07:10
问题 I've seen this and this discussion about removing antialiasing in canvases, but I don't think this is the same thing. After scaling an html5 canvas by an arbitrary value (i.e., making it responsive), I've noticed that if I draw two rectangles of the same size and in the same location, the edges of the scaled side of the first rectangle remain visible. I've included an example snippet where I draw a grey rectangle, then draw an red rectangle on top of it. There's a one-pixel red vertical line