javascript html5中的图像查看器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12506840/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 16:22:35  来源:igfitidea点击:

Image viewer in html5

javascriptasp.net-mvc-3htmlhtml5-canvas

提问by KiranPalode

I have to develop an image viewer application. The designed application should have the following features

我必须开发一个图像查看器应用程序。设计的应用程序应具有以下特点

  1. Zoom in functionality
  2. Zoom out functionality
  3. Magnifying functionality
  4. Pan functionality
  5. Image overview functionality
  1. 放大功能
  2. 缩小功能
  3. 放大功能
  4. 平移功能
  5. 图像概览功能

I have to develop the application in Asp.net application. I have the following questions

我必须在 Asp.net 应用程序中开发应用程序。我有以下问题

  1. What will be the better method to develop such application , I mean Whether it is implemented using Asp.net controls or standard HTML controls
  2. Have any scope of HTML5 in developing such application?
  3. Can i get any customizable open source project written in javascript or jQuery?
  1. 开发这种应用程序的更好方法是什么,我的意思是它是使用Asp.net控件还是标准HTML控件实现的
  2. 在开发此类应用程序中是否有任何 HTML5 范围?
  3. 我可以获得任何用 javascript 或 jQuery 编写的可定制的开源项目吗?

采纳答案by Rob Angelier

My answers to your questions:

我对你的问题的回答:

  1. I would use HTML, since you don't need anything from the server.
  2. There is, you can search google for info.
  3. Look at the info below.
  1. 我会使用 HTML,因为您不需要来自服务器的任何东西。
  2. 有,你可以在谷歌搜索信息。
  3. 看看下面的信息。

I would try the following steps:

我会尝试以下步骤:

  1. Look for examples of the required features.
  2. Strip these examples down and build them up again according to your requirements.
  3. Create a holder for the image. You can load the image from the server with jQuery and AJAX
  4. Implement controls for zooming, panning. Use the implementation you created in step 2
  1. 查找所需功能的示例。
  2. 剥离这些示例,然后根据您的要求重新构建它们。
  3. 为图像创建一个支架。您可以使用 jQuery 和 AJAX 从服务器加载图像
  4. 实现缩放、平移控件。使用您在第 2 步中创建的实现

There is alot of information to be found on the internet. Some examples are:

有很多信息可以在互联网上找到。一些例子是:

Zooming

缩放

http://www.tripwiremagazine.com/2012/07/jquery-image-zoom.html

http://www.tripwiremagazine.com/2012/07/jquery-image-zoom.html

Panning

平移

http://manos.malihu.gr/jquery-image-panning

http://manos.malihu.gr/jquery-image-panning

Overview

概述

http://www.designzzz.com/jquery-slide-show-image-gallery-tutorials-downloads/

http://www.designzzz.com/jquery-slide-show-image-gallery-tutorials-downloads/

Tutorial for pan and zooming with HTML5 canvas

使用 HTML5 画布平移和缩放的教程

http://my.safaribooksonline.com/book/web-development/html/9781449308032/images-on-the-canvas/zooming_and_panning_an_image

http://my.safaribooksonline.com/book/web-development/html/9781449308032/images-on-the-canvas/zooming_and_panning_an_image

回答by theintersect

For me,

给我,

  1. I would use HTML,
  2. Use HTML5 and CSS3 if you can,
  3. Yes, there are plenty. Just type what you need. It seems what you are building is a image slider/gallery. Plenty of those on the web. Just look for it.
  1. 我会使用 HTML,
  2. 如果可以,请使用 HTML5 和 CSS3,
  3. 是的,有很多。只需输入您需要的内容。看来您正在构建的是一个图像滑块/画廊。网上有很多这样的。只是寻找它。

If you have to build it from scratch, what you could do is research, these css properties. scale, zoom, and transitions.

如果您必须从头开始构建它,您可以做的是研究这些 css 属性。缩放、缩放和过渡。

There you go, hope I pointed you in the right direction.

好了,希望我为您指明了正确的方向。