简体   繁体   English

如何通过高度和宽度来调整nativescript-vue中base64图像的大小?

[英]How to resize base64 image in nativescript-vue by height and width?

After selecting an image from image-picker, I want to resize that image in native-script vue. 从图像选择器中选择图像后,我想在本机脚本vue中调整该图像的大小。 Please help me. 请帮我。

I used resize-base64 plugin but its not working : 我使用了resize-base64插件,但无法正常工作:

var resizebase64 = require('resize-base64');  

var img = resizebase64(base64, maxWidth, maxHeight);

If I'm not wrong that JS plugin is for browser, uses Canvas which won't be available in {N} environment. 如果我没错,JS插件适用于浏览器,请使用在{N}环境中不可用的Canvas。 You might to convert it to a actual image and use nativescript-bitmap-factory to resize it. 您可以将其转换为实际图像,并使用nativescript-bitmap-factory调整其大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM