471,318 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

Graphics and large images

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

Aug 16 '05 #1
0 1062

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by SStory | last post: by
2 posts views Thread by Tamer Abdalla via DotNetMonster.com | last post: by
reply views Thread by bullshark | last post: by
8 posts views Thread by Nathan Sokalski | last post: by
4 posts views Thread by Andrew | last post: by
6 posts views Thread by Chris Dunaway | last post: by
1 post views Thread by Frijoles | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.