cloudinary - Cloudinary - 在图像上传小部件中将叠加文本添加到 thumbnailTransformation
问题描述
我正在使用上传图像小部件,我想添加文本叠加但不知道如何,有人可以回答我吗?
thumbnailTransformation: [{ width: 300, height: 300, crop: 'fill', border: "2px_solid_red" }],
解决方案
您需要包含一个overlay
带有覆盖参数的对象的键,在这种情况下,是特定于文本的。
例如 -
thumbnailTransformation: [
{
width: 300,
height: 300,
crop: 'fill',
border: "2px_solid_red"
},
{
overlay: {
font_family: "Arial",
font_size: 20,
text: "Test"
},
gravity: "north_east"
}
]
以下是您可以尝试的 JSFiddle:https ://jsfiddle.net/rhdvgy19/
所有其他可用的文本样式选项都可以在这里找到 - https://cloudinary.com/documentation/image_transformations#styling_parameters
推荐阅读
- bash - 循环遍历带有空格的文件名 Bash 使用变量
- opengl - glGenBuffers 与 glGenTextures
- python - 通过 python 代码验证服务器连接性
- vb.net - Syntax error in INSERT INTO Statement in vb.net using Access database "how can i fix it ?"
- powerbi - 根据另一列的条件查找先前的值
- ios - Swift UITableView Cell 滚动时更改图像
- c++ - 为什么 doew GCC 编译带有值、右值和左值参数的函数?
- javascript - 带有动态菜单的布局
- networking - URL 如何映射到 DNS 中各自的 IP 地址?
- sql - SQL Server:删除重复项并添加列