gpt4 book ai didi

viber - 从 Viber 键盘按钮中获取错误的图像图像

转载 作者:行者123 更新时间:2023-12-04 12:58:10 25 4
gpt4 key购买 nike

我正在使用 PHP 通过 Viber REST API 创建一个 Viber 机器人。我试图了解如何创建 Viber 设置的键盘设计,但无济于事。如何使它看起来与 Viber 键盘设计提供的示例相同?
My Keyboard Design
enter image description here

[
[
'Columns' => 3,
'Rows' => 2,
'Text' => '<font color=\"#494E67\">Smoking</font><br><br>',
'TextSize' => 'medium',
'TextHAlign' => 'center',
'TextVAlign' => 'bottom',
'ActionType' => 'reply',
'ActionBody' => 'Smoking',
'BgColor' => '#f7bb3f',
'Image' => 'https://img.icons8.com/material-outlined/24/000000/smoking.png',
],
[
'Columns' => 3,
'Rows' => 2,
'Text' => '<font color=\"#494E67\">Non Smoking</font><br><br>',
'TextSize' => 'medium',
'TextHAlign' => 'center',
'TextVAlign' => 'bottom',
'ActionType' => 'reply',
'ActionBody' => 'Non smoking',
'BgColor' => '#f6f7f9',
'Image' => 'https://img.icons8.com/material-outlined/24/000000/no-smoking.png',
],
]

最佳答案

Viber 尝试拉伸(stretch)小图像以填充按钮,虽然有办法控制哪个轴最大以及图像是否被裁剪,但无法防止这种拉伸(stretch)。
您可以将每个按钮保存为高分辨率图像(包括文本和图标),然后将该图像用作按钮的 'image' 属性值。
或者,您可以放大当前图像透明背景,使总图像尺寸更大并可以填充按钮(例如 100x100 像素),而图标大小保持不变(24x24 像素)。但是,这种方法的缺点是您需要找到如何在图像中定位图标,使其不与文本重叠。出于这个原因,以前建议使用包含文本和图标的高分辨率图像通常更可取。

关于viber - 从 Viber 键盘按钮中获取错误的图像图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63427581/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com