CALayer content looks "blurry"

  • Dear Friends,

    in the past several days I was playing with Core Animation. I'm
    playing with an app holding images and bezier path as content of a
    view. I moved the view drawing operation "into" a CALayer. Comparing
    the output of the "old" view based drawing with the CALayer output,
    the CALayer output looks blurry. For example the images are not as
    crisp in the details and the lines drawn by the bezier path are not as
    sharp as drawn in the view.

    Is there any way around this? Am I missing something?

    Cheers,
    Michael
  • On Jan 17, 2008, at 7:38 AM, Michael wrote:

    > in the past several days I was playing with Core Animation. I'm
    > playing with an app holding images and bezier path as content of a
    > view. I moved the view drawing operation "into" a CALayer. Comparing
    > the output of the "old" view based drawing with the CALayer output,
    > the CALayer output looks blurry. For example the images are not as
    > crisp in the details and the lines drawn by the bezier path are not
    > as sharp as drawn in the view.

    Are you sure the layer is placed on an integer boundary? If the layer
    is not placed on an integral boundary then it will show interpolation
    artifacts (which typically makes a layer look blurry). If your setting
    the frame you can usually fix this by making sure that the frame is
    passed through CGRectMakeIntegral() before you set it on the layer. If
    your setting the position then you need to account for the anchorPoint
    and the size of the layer to make sure that it is set integrally (it
    might be easier to calculate a frame and then set that instead).

    This may also be caused by having set a transform on the layer or a
    parent layer (via either the transform or sublayerTransform
    properties). If these scale the coordinate system in some way then you
    may be seeing the layer contents scaled. Core Animation always uploads
    layer content at the size of the layer, not at its scaled size, so
    this could also be causing your issues.
    --
    David Duncan
    Apple DTS Animation and Printing
    <david.duncan...>
  • > No web or docs based search finds this function: CGRectMakeIntegral()

    Its really CGRectIntegral() - and so much for going on memory for the
    little things :)
    --
    David Duncan
    Apple DTS Animation and Printing
    <david.duncan...>
  • Hello David,

    Am 17.01.2008 um 20:11 schrieb David Duncan:

    >> No web or docs based search finds this function: CGRectMakeIntegral()
    >
    > Its really CGRectIntegral() - and so much for going on memory for
    > the little things :)
    thank you very much for your reply. This indeed seams to be a the
    problem.

    Cheers,
    Michael
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today