I'm using CGRect to display an image. I'd like the CGRect to use the width and height of the image without me specifying it.
can this:
CGRectMake(0.0f, 40.0f, 480.0f, 280.0f);
become this:
CGRectMake(0.0f, 40.0f, myImage.width, myImage.height);
some images get distorted when I specify the parameters.
here's the code:
CGRect myImageRect = CGRectMake(0.0f, 40.0f, 480.0f, 280.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:recipe.img]];
thanks for any help.