Re: picture control pset performance?
- From: Bruce Bowler <bbowler@xxxxxxxxxxx>
- Date: Tue, 21 Nov 2006 15:37:14 -0500
On Tue, 21 Nov 2006 12:05:36 -0800, Karl E. Peterson put fingers to
keyboard and said:
Bruce Bowler wrote:
This code seems to take an inordinately long time. Any
suggestions on how to make it faster? Alternately, is there
a better way to accomplish what the above does, namely,
take buffer, which is in fact a gray scale image, and display
it at a 50% reduction
There are all sorts of ways to do it, depending on exactly where you
are getting the original image from and what you want to eventually
do with the resized image. Generally, for resizing images you are
usually far better off using a "one off" call to a suitable function
rather than manipulatng the individual pixels directly. You could
use the VB PaitnPicture method or the API StretchBlt or
StretchDIBits method, again depending on exactly what it is you want
to do.
I'm not sure what part wasn't clear, so let me try again, more simply.
I have a byte array that I want to display as an image at 50% on a VB
form. Period. End of sentence.
It shouldn't matter where (or how) I got the image and it shouldn't
matter what I want to do with the data later.
Maybe it shouldn't, but (Mike's the expert) I suspect it does. At least if
you want the most optimal performance. That said...
OK, I'll explain where I get the data and what gets done with it.
I get the data from a camera attached to a microscope (although ANYTHING
that generates a 1392x1040 byte array will do -- even a random number
generator). I massage it a bit, and I write it as a TIFF file (using a
*REALLY* ugly hack) at full resolution, and display it at 50% resolution
so the user can see what's going on. then (as they say on the shampoo
bottle) "lather, rinse, repeat"
Now, PLEASE explain to me why any of that matters...
Bruce
--
+-------------------+---------------------------------------------------+
Bruce Bowler | I want to die peacefully in my sleep like my
1.207.633.9600 | grandfather, not screaming in terror like his
bbowler@xxxxxxxxxxx | passengers - Anon
+-------------------+---------------------------------------------------+
.
- Follow-Ups:
- Re: picture control pset performance?
- From: Schmidt
- Re: picture control pset performance?
- From: Karl E. Peterson
- Re: picture control pset performance?
- References:
- picture control pset performance?
- From: Bruce Bowler
- Re: picture control pset performance?
- From: Mike Williams
- Re: picture control pset performance?
- From: Bruce Bowler
- Re: picture control pset performance?
- From: Karl E. Peterson
- picture control pset performance?
- Prev by Date: Re: problem with VB6 webbrowser control after installing IE7
- Next by Date: Re: How Big is Too Big?
- Previous by thread: Re: picture control pset performance?
- Next by thread: Re: picture control pset performance?
- Index(es):
Relevant Pages
|