展开全部
Swing桌面应用程序可以实现
HTML可以实现
给你个实例做参考
/**
* 负责显示各种格式的图片e68a84e8a2ad62616964757a686964616f31333236386236
*
* @author 喜来乐哈哈
*/
public class ImageViewer extends Canvas {
protected Point origin = new Point(0, 0);
protected Image image;
protected ImageData[] imageDatas;
protected Image[] images;
protected int current;
private int repeatCount;
private Runnable animationTimer;
private ScrollBar hBar;
private ScrollBar vBar;
private Color bg;
private Display display;
public ImageViewer(Composite parent) {
super(parent, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL
| SWT.H_SCROLL);
hBar = getHorizontalBar();
vBar = getVerticalBar();
bg = getBackground();
display = getDisplay();
addListeners();
}
public void setImage(ImageData imageData) {
checkWidget();
stopAnimationTimer();
this.image = new Image(display, imageData);
this.imageDatas = null;
this.images = null;
redraw();
}
/**
* @param repeatCount 0 forever
*/
public void setImages(ImageData[] imageDatas, int repeatCount) {
checkWidget();
this.image = null;
this.imageDatas = imageDatas;
this.repeatCount = repeatCount;
convertImageDatasToImages();
startAnimationTimer();
redraw();
}
@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
checkWidget();
Image image = getCurrentImage();
if (image != null) {
Rectangle rect = im