I am trying to create a UIPickerView with some images in it, but I cannot figure out how to get the images according to the view (now they are too big and overlap each other).
I try to use a function to resize each image when drawing, but I get errors when calling the function, although the program compiles and works fine (except for the image without resizing). Resize function and initialization function:
-(UIImage *)resizeImage:(UIImage *)image width:(int)width height:(int)height { NSLog(@"resizing"); CGImageRef imageRef = [image CGImage]; CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef);
Console output:
TabTemplate [29322: 207] resize
TabTemplate [29322]: CGBitmapContextCreate: unsupported color space
TabTemplate [29322]: CGContextDrawImage: invalid context
TabTemplate [29322]: CGBitmapContextCreateImage: invalid context
I can not understand what is happening. Any help is appreciated.
Paul woidke
source share