Photoshop background a little blurry.

Discussion in 'iOS Programming' started by Ernie11, Apr 27, 2014.

  1. Ernie11, Apr 27, 2014
    Last edited: Apr 28, 2014

    Ernie11 macrumors member

    Joined:
    Apr 4, 2014
    #1
    Hello everyone. Im working on the graphics of my app but I noticed that some of the backgrounds are a little blurry and on some the background is fine but the letters that I put straight into the background in photoshop are blurry. For what I know photoshop is the tool to do this for apps. This is the code im using to incorperate the background.
    Code:
        UIGraphicsBeginImageContext(self.view.frame.size);
        [[UIImage imageNamed:@"Background.png"] drawInRect:self.view.bounds];
        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        self.view.backgroundColor = [UIColor colorWithPatternImage:image];
    I also made some images to put as the background of cells but the different words I put there with photoshop aswell are blurry but the border of the "button" looks clear. Any tips, tricks, or tuts anyone can share would be great. Thanks.

    [EDIT]
    By the words I mean they are not as clear as the ones I added in using labels and such. Its the same font and color but not size, which shouldnt make a difference.

    [EDIT 2]
    Figured out the text being blurred part. Didnt add the @2x for them. I did check the other backgrounds and made sure the @2x was added and also checked to make sure they were really @2x. Still have the slight background blur.

    E.
     
  2. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #2
    Code:
        UIGraphicsBeginImageContext(self.view.frame.size);
        [[UIImage imageNamed:@"Background.png"] drawInRect:self.view.bounds];
        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        self.view.backgroundColor = [UIColor colorWithPatternImage:image];
    Why do you do that???? Like, really?

    a couple of pointers,
    1) make sure the device don't have to scale the image.
    2) make sure the image is not drawn at any half pixel coordinates
    3) don't incorporate text in images, use uilabels instead.

    You can't just add a UIImageView?
     
  3. Ernie11 thread starter macrumors member

    Joined:
    Apr 4, 2014
    #3
    Ok I changed the previous code to:
    Code:
    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"Background.png"]]];
    I was using the above one because for some reason when I would set the background it was 1 pixel off to the left. Its not anymore. Looks better which is what I was looking for. Thanks. Any other tips would be nice for future use of me or anyone else that runs into this post. Thanks again.

    E.
     

Share This Page