0
현재 재생중인 iPod 작품의 PNG 표현을 250x250 크기로 가져 오려고합니다. 그러나 나는 640x640 이미지를 계속 얻고있다. 코드는 다음과 같습니다. 아무도 틀림없이 틀린 실수를 지적 할 수 있습니까?정의 된 크기로 현재 재생중인 iPod 작품의 PNG 가져 오기
- (NSData *) getNowPlayingPng
{
// Assume that there is no artwork for the media item.
UIImage *artworkImage = [[UIImage alloc]init];
// Get the artwork from the current media item, if it has artwork.
MPMediaItemArtwork *artwork = [iPodController.nowPlayingItem valueForProperty: MPMediaItemPropertyArtwork];
// Obtain a UIImage object from the MPMediaItemArtwork object
if (artwork) {
artworkImage = [artwork imageWithSize:CGSizeMake(250.00, 250.00)];
}
NSData *pngimage = UIImagePNGRepresentation(artworkImage);
return pngimage;
}
이미지가 웹 브라우저에 제공되므로 표준 파일 형식이어야합니다. – Monty