가능한 중복 : 나는 두 이미지 전경 이미지 회전을 사용한
How to merge two images after rotate the image?회전 이미지를 배경 이미지와 병합하는 방법은 무엇입니까?
는 배경 이미지는 안정적이다. 이 두 이미지를 병합하는 방법은 무엇입니까? 그게 나를 위해 제대로 작동하지 않습니다. 미리 감사드립니다.
UIGraphicsBeginImageContext(itemSize);
CGRect backgroundImageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
CGRect foregroundImageRect = CGRectMake(rsImageView.frame.origin.x, rsImageView.frame.origin.y, rsImageView.frame.size.width, rsImageView.frame.size.height);
[backgroundImageView.image drawInRect:backgroundImageRect];
[rsImageView.image drawInRect:foregroundImageRect];
overlappedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
이 코드를 사용하고 있습니다. 그러나 회전 이미지를 병합하지 마십시오. 그것만이 마지막 이미지 프레임을 병합합니다.
무슨 시도를 imgDisplayImage입니다? 어떻게 실패 했니? 오류가 무엇입니까? 당신의 코드는 무엇입니까? –
UIGraphicsBeginImageContext (itemSize); CGRect backgroundImageRect = CGRectMake (0.0, 0.0, itemSize.width, itemSize.height); CGRect foregroundImageRect = CGRectMake (rsImageView.frame.origin.x, rsImageView.frame.origin.y, rsImageView.frame.size.width, rsImageView.frame.size.height); [backgroundImageView.image drawInRect : backgroundImageRect]; [rsImageView.image drawInRect : foregroundImageRect]; overlappedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); 나는 이렇게 시험해 보았다. 그러나 회전 이미지가 제대로 병합되지 않습니다. – Mani
의견에 많은 양의 코드를 게시하는 대신 질문을 편집하십시오. 감사! –