如何在代码中“照亮" iPhone上的png? [英] How can I ‘shine’ a png on the iPhone in code?

查看:61
本文介绍了如何在代码中“照亮" iPhone上的png?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何复制应用启动器在正方形.png上使用的效果,以向用户显示其图标作为应用徽章的外观.

How do I replicate the effect that the app launcher uses on a square .png to show my users what their icon will look like as an app badge.

注意-我想在iPhone上而不是在计算机上的photoshop中使用此代码.

NB - I want to do this in code on the iPhone, not in photoshop on my computer.

谢谢!

试图在这里弄清楚.我该如何使用 code ! 我曾尝试创建一个叠加层,但是闪耀的苹果实际上确实使顶部变亮,因此仅在顶部放置png不会产生相同的效果.

edit: trying to be really clear here. How do I do this with code! I have tried creating an overlay, but the shine apple does actually brightens the top, so just putting a png over the top will not give the same effect.

大概是应用启动器会应用一些CA效果-有人知道如何复制它们吗?

Presumably the app launcher applies some CA effects - does anyone know how to duplicate them???

推荐答案

另一种更简单的方法是将您的图标另存为57px x 57px PNG,称为"icon.png",而没有任何闪光效果,然后将其通过FTP传输到根文件夹Web服务器,然后在其中创建一个名为icon_test.html的文件,其中包含以下代码:

Another more simple approach is to save your icon as a 57px x 57px PNG called "icon.png" without any shine effects, then FTP it to the root folder of a web server and create a file there called icon_test.html containing the following code:

<html>
    <head>
        <link rel="apple-touch-icon" href="/icon.png"/> 
        <title>The App Name</title>
    </head>
    <body>
         iPhone test page
    </body>
</html>

然后只需在iPhone上的移动Safari中浏览到icon_test.html文件,点击工具栏中的"+"按钮将页面另存为书签,点击添加到主屏幕",然后点击右上角.然后,您会看到您的图标出现在主屏幕上,并带有Apple的光泽覆盖.

Then just browse to the icon_test.html file in mobile Safari on your iPhone, tap the "+" button in the toolbar to save the page as a bookmark, tap "Add to Home Screen", and tap "Add" in the top right. You'll then see your icon appear on the home screen, complete with Apple's shine overlay.

这篇关于如何在代码中“照亮" iPhone上的png?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆