最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ios - Why is ImagePlaygroundViewController sourceImage not working? - Stack Overflow

programmeradmin0浏览0评论

I'm trying to create a ImagePlaygroundViewController in my iOS application and it works great. However when I try to pass in a sourceImage property it doesn't use that sourceImage as the base for the image it generates. Normally with ImagePlayground it shows the image around the image it generates, but it isn't doing that.

I'm trying to create a ImagePlaygroundViewController in my iOS application and it works great. However when I try to pass in a sourceImage property it doesn't use that sourceImage as the base for the image it generates. Normally with ImagePlayground it shows the image around the image it generates, but it isn't doing that.

Share Improve this question asked Nov 16, 2024 at 23:54 Charlie FishCharlie Fish 20.7k23 gold badges107 silver badges200 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

It took me hours of research to figure out what is going on here. There are a few requirements in order for ImagePlayground to use your sourceImage.

  • Image must be at least 384x384 pixels
  • Image must be no larger than 4096x4096 pixels
  • Image must be square

While Apple does mention the recommended sizes in the documentation they make it sound like it's a recommendation as opposed to a requirement. Additionally Apple doesn't mention anything about the image needing to be square.

For some reason when you manually add an image to an ImagePlayground it doesn't seem like any of these requirements apply. It seems to only apply when passing in images through that sourceImage property.

I tested this on iOS 18.2 (22C5131e) and Xcode 16.1 (16B40).


Edit: I just tested this some more. And it looks like images larger than 2048x2048 pixels also do not work. This was tested on the same versions as mentioned above.

发布评论

评论列表(0)

  1. 暂无评论