Web:圖像旋轉和縮放的解決方案

[英]Web: solution for image rotate and zoom


I have a web page which displays a large image, for example a page from a magazine. I have no control over the image size or orientation. It's possible that the image may need to be rotated by the user to orient it correctly.

我有一個顯示大圖像的網頁,例如雜志中的頁面。我無法控制圖像大小或方向。用戶可能需要旋轉圖像才能正確定位圖像。

Are there any Javascript or Flash solutions that will allow someone to rotate and zoom a given image? Ideally I'd specify a single image and the dimensions to use when displaying it. If the image is larger than those dimensions, the user could zoom in and view a portion of the image in greater detail.

有沒有允許某人旋轉和縮放給定圖像的Javascript或Flash解決方案?理想情況下,我會指定單個圖像以及顯示時使用的尺寸。如果圖像大於那些尺寸,則用戶可以放大並更詳細地查看圖像的一部分。

2 个解决方案

#1


I've seen a couple of solutions for rotating images with straight Javascript and CSS. Raphael would do the trick. There is apparently even an example featuring rotating an image. (it uses SVG but is support on all major browsers)

我已經看到了幾個使用直接Javascript和CSS旋轉圖像的解決方案。拉斐爾會做的。顯然甚至有一個旋轉圖像的例子。 (它使用SVG,但支持所有主流瀏覽器)

This one is not cross browser, but is an interesting exercise nevertheless.

這個不是跨瀏覽器,但仍然是一個有趣的練習。

As for flash rotation etc...

至於閃光旋轉等......

#2


For rotating images, I used jquery-rotate and it works very well.

對於旋轉圖像,我使用了jquery-rotate,效果非常好。

It is not totally cross-browser, it doesn't work with IE6 (and probably other old browsers).

它不是完全跨瀏覽器,它不適用於IE6(可能還有其他舊瀏覽器)。

For zooming, I guess you could make your own implementation using javascript, you can just resize the image (easy with jQuery).

對於縮放,我猜你可以使用javascript制作自己的實現,你只需調整圖像大小(使用jQuery很容易)。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/04/24/72fd4daee30240c65172f05a3e454571.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com