Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


poor image quality of stretched images in vb6 image control.

Posted on 2004-10-26
Medium Priority
Last Modified: 2012-05-05
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?
Question by:btetu
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 32

Accepted Solution

Erick37 earned 600 total points
ID: 12411828
Hi btetu

Have a look here:
Smooth picture Resizing ...(using Pixel sampling maybe)
LVL 16

Expert Comment

ID: 12412021
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!!

LVL 55

Expert Comment

by:Jaime Olivares
ID: 12412123
Have a look to this control:

Author Comment

ID: 12414321
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.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question