scrolling slow when viewing image first time

Discussions about document viewing.
Post Reply
cliebl
Posts: 9
Joined: Wed Jun 13, 2007 10:01 pm

scrolling slow when viewing image first time

Post by cliebl » Thu Jun 14, 2007 11:09 pm

Ok, I got help before on getting my image to scroll to the top left position by doing the following:

gdviewer1.SetZoomWidth
gdviewer1.LockScreen = True
gdviewer1.DisplayFromFile(myImage)
gdviewer1.SetHVScrollBarPosition(0,0)
gdviewer1.LockScreen = False
gdviewer1.Redraw()

I'm having complaints that the scroll is too small so I saw in the forum I need to set the scrollsmallchange. It does work but I've notice a behavior not sure how to fix.

Whenever the code listed above is executed, when I scroll it's slower and jerky. But if I zoom on the screen, then try the scrollbars it works great. I can't figure out why that first time it's so slow.

Any ideas?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Thu Jun 21, 2007 6:54 pm

Hi,

Sorry for the late.


With the last beta-release https://www.gdpicture.com/ressources/betas/


You can replace your code

Code: Select all

gdviewer1.SetZoomWidth
gdviewer1.LockScreen = True
gdviewer1.DisplayFromFile(myImage)
gdviewer1.SetHVScrollBarPosition(0,0)
gdviewer1.LockScreen = False
gdviewer1.Redraw()

by this one


Code: Select all

gdViewer1.ImageAlignment = ImagePositionTopLeft
gdViewer1.InterpolationMode = 1

I think it will increase your scroll speed.


Best regards,

Loïc Carrère

cliebl
Posts: 9
Joined: Wed Jun 13, 2007 10:01 pm

Post by cliebl » Sat Jun 23, 2007 5:58 am

Ok, I tried out the beta version.

This is what I currently have:

gdviewer1.SetZoomWidth
gdViewer1.ImageAlignment = ImagePositionTopLeft
gdviewer1.DisplayFromFile(myImage)

I didn't do the interpolationmode because my documents weren't as clear. What I did notice is if use the SetZoomWidth then that seems to be what's slowing it down. If I leave that out then the scrolling is great. Unfortunately I really need the SetZoomWidth option to set my document to width of the control. Any ideas?

And thank you for the help!

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Mon Jun 25, 2007 2:49 pm

Hi,

To increase the viewer speed you can try to force your applicaiton tu use the gdiplus.dll which are include in the gdpicture pro package:


- Creates an empty ApplicationName.exe.local file in the same directory as your application. (Use your applicaiton name instead ApplicationName).
- Copy to the gdiplus.dll of the redist forder into this same directory.
Best regards,

Loïc Carrère

cliebl
Posts: 9
Joined: Wed Jun 13, 2007 10:01 pm

Post by cliebl » Wed Jun 27, 2007 11:38 pm

Ok, here's the problem. I can recreate this in vb6.

If I have the above code it will scroll slowly:

Me.gdViewer1.LockScreen = True
Me.gdViewer1.DisplayFromFile ("c:\images\test.tif")
Me.gdViewer1.ImageAlignment = ImagePositionTopLeft
Me.gdViewer1.SetZoomWidth
Me.gdViewer1.LockScreen = False
Me.gdViewer1.Redraw



If I have the code below it will scroll the way I want it but I get that blinking effect because I load the image then I change the way to view it after it's loaded.

Me.gdViewer1.DisplayFromFile ("c:\images\test.tif")
Me.gdViewer1.LockScreen = True
Me.gdViewer1.ImageAlignment = ImagePositionTopLeft
Me.gdViewer1.SetZoomWidth
Me.gdViewer1.LockScreen = False
Me.gdViewer1.Redraw


I didn't know if there's a way to fix this or any suggestions on doing it differently or is the only way to do it by your previous post? The viewer speed is ok, it's just the scrolling.

Maybe someone else has run across this??

cwseetoh
Posts: 2
Joined: Mon Jul 09, 2007 11:58 am

Post by cwseetoh » Thu Jul 12, 2007 10:32 am

I'm currently evaluating using the trial version, and I have the same slow scrolling problem. But my situation is slightly different, cos I don't even have the LockScreen command. But its still slow.

I'm embedding the ocx in the web. So how do I force it to use gdiplus.dll?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Thu Jul 12, 2007 1:34 pm

Hi both,

I've found a way to optimize the scoll speed.

Into the next release there will be a new propertie: ScrollOptimization

When you will turn this propertie to True the scoll will be fastest.

Best regards,

Loïc

cliebl
Posts: 9
Joined: Wed Jun 13, 2007 10:01 pm

Post by cliebl » Thu Jul 12, 2007 3:55 pm

Thanks Loic! I will have to try that out when it's ready.

My issue was in MOST situations I load the image and use SetZoomWidth. It would scroll slow but then if I zoomed on the image it would then be fast and if I set it back to the SetZoomWidth it would be fast too. It seemed to be just when viewing the image the first time (and related tot he locking).

To get around it I first hide my viewer, then I zoom at 50%, open the file (DisplayFromFile), call SetZoomWidth, then unhide. I had to hide the control to not see the image resizing. I couldn't use the lock because when I had that it the code, the scrolling would be slow. So that's how I got around it for now.

Thanks, I'll watch for the update.

cwseetoh
Posts: 2
Joined: Mon Jul 09, 2007 11:58 am

Post by cwseetoh » Fri Jul 13, 2007 7:21 am

Great! Tks for the fast response!

Just curious, will there be any penalty for setting the scroll optimization? Are we sacrificing something else for this feature? If not, then why would anybody want to set it to false?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Fri Jul 13, 2007 5:53 pm

Hi,

The last release is available:

GdViewer Pro:
https://www.gdpicture.com/products/gdvie ... ctivex.php

GdViewer STD:
https://www.gdpicture.com/products/gdvie ... ctivex.php
Just curious, will there be any penalty for setting the scroll optimization?
Yes, the image loading time is a bit extended. However you can turn off the scroll optimization using the new ScrollOptimization propertie:
https://www.gdpicture.com/references/gdv ... ation.html

Best regards,

Loïc Carrère

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest