B
bullshark
I have a C# application that manipulates images. The application provides
the ability to pan around the images. Normally you can "grab" the image
and move it around and it moves in real time with the mouse cursor.
There is very low friction. It slides easily.
My problem is that with larger images, it just turns to mud.
Refreshing the image, or re-drawing a screenful take so long that
trying to pan the image results in jumpy, jerky movements.
There is very high friction. It is sticky.
"Larger" images are on the order of 5000 x 10000 color jpg.
I am viewing a rectangle of the original image with no scaling
and drawing the image in OnPaint. It's all pretty standard stuff and
seems to be unresponsive to double buffering on or off.
It won't do "Big" Images at all. It just chokes trying to Image.FromFile.
I have gigaram and plenty of swap and I just don't understand why it fails
on images with a footprint over about 1.5 gig (l*w*colorbytes). Is GDI limited
to signed 32 address space?
*Interestingly*, when I single step somewhere (anywhere) in the debugger and
then continue (f5), the image will start moving easily and smoothly, of it's
own accord. This really bugs me. If the debugger can set some condition that
makes this stuff run well, then I should be able to do it too. Am I doing something
wrong? What does the debugger do to the graphics objects or memory when at
breakpoints?
The general logic
o uses onMouseMove/Down/Up to track drags of the image
o uses DrawImage( Image,drawRect,ImgRect,GraphicsUnit.Pixel) in OnPaint
o draws scale=1:1
o use double buffering (on/off doesn't matter for purposes of slowdown)
o disposes of any created graphic objects as soon as they're not needed
I am looking forward to your suggestions,
bullshark
the ability to pan around the images. Normally you can "grab" the image
and move it around and it moves in real time with the mouse cursor.
There is very low friction. It slides easily.
My problem is that with larger images, it just turns to mud.
Refreshing the image, or re-drawing a screenful take so long that
trying to pan the image results in jumpy, jerky movements.
There is very high friction. It is sticky.
"Larger" images are on the order of 5000 x 10000 color jpg.
I am viewing a rectangle of the original image with no scaling
and drawing the image in OnPaint. It's all pretty standard stuff and
seems to be unresponsive to double buffering on or off.
It won't do "Big" Images at all. It just chokes trying to Image.FromFile.
I have gigaram and plenty of swap and I just don't understand why it fails
on images with a footprint over about 1.5 gig (l*w*colorbytes). Is GDI limited
to signed 32 address space?
*Interestingly*, when I single step somewhere (anywhere) in the debugger and
then continue (f5), the image will start moving easily and smoothly, of it's
own accord. This really bugs me. If the debugger can set some condition that
makes this stuff run well, then I should be able to do it too. Am I doing something
wrong? What does the debugger do to the graphics objects or memory when at
breakpoints?
The general logic
o uses onMouseMove/Down/Up to track drags of the image
o uses DrawImage( Image,drawRect,ImgRect,GraphicsUnit.Pixel) in OnPaint
o draws scale=1:1
o use double buffering (on/off doesn't matter for purposes of slowdown)
o disposes of any created graphic objects as soon as they're not needed
I am looking forward to your suggestions,
bullshark