Skip to content

Random Image Generator #3

@BandoKal

Description

@BandoKal
  • (UIImage *)testImageWithColor:(UIColor *)color {
    CGRect rect = CGRectMake(0.0f, 0.0f, 100.0f, 100.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return image;
    }
    UIImage *testImage = [self testImageWithColor: [UIColor blueColor]];
    NSData *jpgTestImageData = UIImageJPEGRepresentation(testImage, 1.0);

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions