更新图像无闪烁ASP.NET C# [英] Update image without flickering ASP.NET C#

查看:163
本文介绍了更新图像无闪烁ASP.NET C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个网站具有一个页面,必须显示的图像。此图片是通过创建一个HttpHandler使用查询字符串命令,我怎样才能使这个工作没有任何闪烁的?

Im writing a web site which has a page that must show an image. This image is created by an HttpHandler using querystring commands, how can I make this works without any kind of flickering?

在此先感谢,如果你需要一些代码,我很高兴来分享吧!

Thanks in advance, if you need some code Im happy to share it!

推荐答案

我用下面的代码的一个项目,在那里我有类似的问题。也许这可以帮助您解决问题。

I used the following code for a project, where I had a similar problem. Maybe this can help solve your issue.

 (function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

预加载图像之后,过渡是非常流畅。

After preloading the images, the transition was very smooth.

PS我不记得在那里我得到这个,所以我不能给信贷。对不起。

p.s. I don't remember where I got this, so I can't give credit. Sorry.

这篇关于更新图像无闪烁ASP.NET C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆