Allan McLemore
10/24/2004 4:30:00 PM
Hi there,
I have made an image box which includes magnification features. All
works well except I have noticed a bottle neck when viewing images that are
very large (via high maginification).
The magnified image only gets created once so I can pin point the bottle
neck down to 1 line, and it's the DrawImage routine via the destinations
graphics object. Anyway, regardless of this, I have timed the method at
small image sizes and at large image sizes and the large ones take
considerably longer.
My question is how can I speed up drawImage??
Call iGraphics.DrawImage(cBmpAfterMagnification, pRecDestRectangle,
pRecViewPortal, GraphicsUnit.Pixel)
This is the line in question, the objects are as follows,
cBmpAfterMagnification = Source image
pRecDestRectangle = Destination rectangle, always starts at (0,0)
pRecViewPortal = Source rectangle, can be anywhere in the image at the
same dimensions of the destination rectangle
Anyway, with small images (960 x 1280) this line can complete in
something like 0-16ms, with an image 3 times the size it will complete in
roughly 110-150ms. I have tried using the GDI API but have had problems
with getting the device context for both graphics objects. But anyway,
surely this routine shouldn't slow down this much, or is there a way to
speed it up?
Cheers in advance for any help!
Nick.