简体   繁体   English

如何使用Imagick将图像转换为另一种格式并在画布中显示?

[英]How to convert an image into another format using Imagick and display that in canvas?

I am using Imagick library to convert an image in TIFF format to PNG image. 我正在使用Imagick库将TIFF格式的图像转换为PNG图像。 It works perfectly fine. 它工作得很好。 But the real problem is I cannot render the image into html5 canvas. 但是真正的问题是我无法将图像渲染到html5 canvas中。 TIFF image contains multiple pages. TIFF图像包含多个页面。 I have a pagination on top of my web page. 我的网页上有一个分页。 When I click on each, I want to convert corresponding page in TIFF to PNG and display it in canvas, which is not working. 当我单击每个页面时,我想将TIFF中的相应页面转换为PNG并将其显示在画布中,这是行不通的。 Any advice? 有什么建议吗?

Check out this . 看看这个 If you have a php page that already returns the requested image then just change the contents of the Image.src property to point at that service with the file and page number in the parameter string. 如果您的php页面已经返回了所请求的图像,则只需更改Image.src属性的内容以指向该服务,并使用参数字符串中的文件和页面编号即可。

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

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