all groups > dotnet jscript > january 2006 >
You're in the

dotnet jscript

group:

how to defer the redraw of the img or the document


how to defer the redraw of the img or the document Charlie Hoo
1/31/2006 4:09:47 PM
dotnet jscript:
Hello,

I am working on a html page as simple as following:

<html><head><title>test</title>
<script language="javascript">
function doZoom()
{
var zoom=parseInt(oImg.style.zoom) + z;
oImg.style.zoom = zoom + "%";
document.body.scrollLeft += 10;
document.body.scrollTop +=10;
}
</script>
</head>
<body STYLE="OVERFLOW:hidden;padding:0px;margin:0px;">
<table id="oTable" width=100% height=100% cellpadding=0
cellspacing=0><tr><td align=center valign=middle>
<img id=oImg onmousedown="doZoom();" style="zoom:100%">
</td>
</tr>
</table>
</body>
</html>

It works fine except that the screen will flick as it first do the zooming,
then it move to the left by 10px. How to make the function flickless? In
other words, how to make the document to update the screen only once instead
multiple times?

Thanks a lot.

Charlie

RE: how to defer the redraw of the img or the document v-kevy NO[at]SPAM online.microsoft.com
2/1/2006 12:00:00 AM
Hi Charlie,

Do you mean that the image on the page is flashing or flicking? I tried
with a small jpg file (96*96) on my machine, and it works fine. If the
picture is too big, it will be flicking because of the performance. It is a
behavior by IE. AFAIK, We can do nothing to prevent this from happening.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Re: how to defer the redraw of the img or the document Charlie Hoo
2/1/2006 8:47:47 AM
Hello, Kevin,

You need to have jpg file larger than your IE window size to see the
flicking. I use a jpg file(1280x960) for the test. In MFC application, I can
defer the update(redrawing) of the interface until I want to, I wonder if it
is possible to do that with DHTML for IE document?

Thanks a lot.

Charlie

[quoted text, click to view]

Re: how to defer the redraw of the img or the document v-kevy NO[at]SPAM online.microsoft.com
2/2/2006 12:00:00 AM
Hi Charilie,

I have reproduced this on my machine with a larger picture. But
unfortunately, AFAIK, there is nothing we can do on this, because all of
them are handled by IE, unlike in MFC windows form apps.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
AddThis Social Bookmark Button