poor image quality of stretched images in vb6 image control.

I was hoping that someone can help me find a solution to this problem. I am writing a scanning application. I scan in images, then display them in different sized image controls. I have the stretch property turned on. The quality of the image displayed is extremely poor compared to the image that is displayed by other applications displaying the same file at the same physical size on the screen. Are there anyways to improved the quality of the stretched image? Or any controls that can do the same stretch but will not lower the quality so dramatically?
Who is Participating?
Erick37Connect With a Mentor Commented:
Hi btetu

Have a look here:
Smooth picture Resizing ...(using Pixel sampling maybe)
The problem with the Image control's stretch method is that there is no interpolation; it simply multiplies the pixels to 'blocks', as it were (double size is pixelwidth * 2 x pixelheight * 2).

You need to get the colour value of one pixel, the color values of the one to the right and the one below.  Then, you need to determine how many pixels away the new, resized, image will display the next pixel, then use this distance to determine by how much the first pixel's colour changes for every one pixel required to reach the destination of the second one, increasing/decreasing the colour values to match.

I'm confusing myself just writing about it, so I suggest you use the class in the link provided by Erick37 -- it does all of that for you!!

Jaime OlivaresSoftware ArchitectCommented:
Have a look to this control:
btetuAuthor Commented:
Thanks Erik, that was very helpful. The quality is better, but i was still hoping for something more. When compared to the image generated by ms office at the same size is still 100x better. Damn microsoft! Thanks for your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.