You have cleared the rect using
CGContextClearRect(context, self.bounds);
This will make your context and view transparent so, Check your super view's color may be it's black. If you want it white you can do like
CGContextClearRect(context, rect);
CGContextSetStrokeColorWithColor(context, [UIColor whiteColor].CGColor);
Reason of image stretching
CGContextDrawImage
will scale image to fit into specified rect. So,try to provide a rect in a such a way that it's aspect ratio will be maintain.
Here I have provide few link which using some calculation to calculate rect or size
Resize image with keeping aspect ratio
UIImage aspect fit