Je prends une capture d'écran dans mon application. Je suis capable de prendre la capture d'écran.UIGraphicsBeginImageContext avec les paramètres
Maintenant, je veux prendre la capture d'écran en spécifiant les coordonnées x et y. Est-ce possible?
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* aImage = UIGraphicsGetImageFromCurrentImageContext();
Merci pour la réponse ... Y at-il un moyen de chager sa hauteur et sa largeur? – user198725878
@barbgal: Utilisez CGContextScaleCTM pour redimensionner. En outre, vous pouvez avoir besoin d'un contexte plus petit (remplacez l'argument par UIGraphicsBeginImageContext). – kennytm
@Barbgal: Non. 'CGSize size = self.view.bounds.size; UIGraphicsBeginImageContext (CGSizeMake (size.width, size.height-40)); CGContextRef c = UIGraphicsGetCurrentContext(); ' – kennytm