UIView animation: really bad result.

Discussion in 'iPhone/iPad Programming' started by jrdoner, Dec 21, 2009.

  1. macrumors newbie

    Joined:
    Nov 26, 2009
    Location:
    Florida
    #1
    0

    I set up a small view, placed three concentric circles in it, and then applied the CGAffineTransformMakeScale function to it. This was meant to achieve the effect of expanding ripples, but unfortunately, the circles become very pixelated as they expand.

    I would have thought that these transforms take advantage of the fact that Coregraphics draw routines create vector graphics, but my expanded image looks like an enlarged bitmap with no smoothing at all.

    I guess I could create expanding circles by some sort of exotic timer dance, but is there a way to get good results just using the CGAffineTransforms?

    Thanks for any insights on this.

    jrdoner
     
  2. macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #2
    When you say that you "placed" three circles in it, what do you mean? Did you insert three UIImageViews with circle bitmaps?

    If you don't want pixelation, you will need to create a UIView subclass with custom drawing code. I assume this is what you did.

    When you animate with Core Animation, it's usually animating a cached bitmap of your view (which is why it looks so smooth). This is why it starts to pixelate. There is a command that makes your animation redraw with every frame; this is probably what you want -- you will probably take a performance hit, though.

    You might also want to take a look at OpenGLES for this kind of functionality.
     
  3. macrumors newbie

    Joined:
    Dec 17, 2009
    Location:
    Vancouver, BC
    #3
    Coregraphics can draw vector graphics, but they have to start as vector graphics. You'll need to convert the image to a vector graphic first.
     
  4. thread starter macrumors newbie

    Joined:
    Nov 26, 2009
    Location:
    Florida
    #4
    I used the path commands (...addArc) to draw the circles: do those commands not create vector graphics? If not, how do I insure that I created a vector graphic?
     

Share This Page