Hi tychop, thanks for your help.
I´ve already tried that but the result is not a text as part of the image, I mean, if I try to show that UIimage in other UIImageViewer the text doen´s appear.
This is my code:
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 4 * width, colorSpace, kCGImageAlphaPremultipliedFirst);
CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
//White background
CGContextFillRect(context, CGRectMake(0.0, 0.0, width, height));
CGContextSelectFont(context, "Arial", 6, kCGEncodingMacRoman);
CGContextSetTextDrawingMode(context, kCGTextFill);
CGContextSetCharacterSpacing(context,kCGRenderingI ntentDefault);
CGContextSetRGBFillColor(context, 0, 0, 0, 1);
labelInstructions = [[UILabel alloc] initWithFrame:imagen_view2.frame];
labelInstructions.font = [UIFont systemFontOfSize: 16];
labelInstructions.lineBreakMode = UILineBreakModeWordWrap;
labelInstructions.numberOfLines = 0;
labelInstructions.backgroundColor = [UIColor clearColor];
labelInstructions.text = @"..long text string repito long text string..";
[self.view addSubview:labelInstructions];
CGImageRef imageMasked = CGBitmapContextCreateImage(context);
UIImage *resultingImage = [UIImage imageWithCGImage:imageMasked];
Any help, please?
|