Solved

Graphic formats and quality (only for experts)

Posted on 2002-07-22
7
210 Views
Last Modified: 2010-05-02
I am using a .jpg file and a .bmp file in two different picture boxes. I am printing the pictures using the printer object in visual basic (through paintpicture property). I want to know is there any different in quality between the two file formats.

i.e. how does VB represet the graphic file to the printer.Does VB recognizes the difference between the two format I used in picture boxes and sends it as separate information to the printer.

Please give me more details about how to control the priter object more accurately to find the difference between the two printers. Or is there any advance method in VB like using API to send the graphic file to the printer.
0
Comment
Question by:tppradeep18
[X]
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
7 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 7169996
The only difference between a .bmp and a .jpg is that they are stored in different formats.  Once loaded into VB, they are no longer .bmps or .jpgs; they are picture objects.

When you print, you are printing a picture object not a bmp or a jpg.  This is also one reason why when you save a picture it always puts it in .bmp format.

When you resize the container which has the picture, VB goes back to the picture object and uses that to display more of the picture if necessary.

If the picture is in an image control, and the Stretch property is true, the picture is retained in its picture object, and the picture is displayed stretched through a separate calculation.  If restretched, it again goes to the picture object to calculate how to resize the image.

0
 
LVL 18

Expert Comment

by:mdougan
ID: 7172517
So, as rspahitz is saying, once the picture is in the picturebox, it makes no difference what the initial format was.  However, the initial format of the picture may have caused a loss of quality before it was even loaded into VB.

So, if you had a high resolution scanned image and you converted it into a 24-bit bmp and also into a mid to low quality jpg, the jpg would be a substantially smaller file, because of the jpg compression performed.  This compression can lose a significant amount of graphic data, such that if you were to load two VB picture boxes, one from the saved 24-bit bmp and one from the saved jpg, the picturebox with the jpg image loaded into it would not have a high quality image as the one loaded from the .bmp, and would print with lower quality.
0
 
LVL 2

Author Comment

by:tppradeep18
ID: 7173455
both of you have given nice information. thanks for that. I want to know whey both images look similar on the screen and once printed look very different. Also want to know, to print the graphics is there any other method other than using printer object. I am really concerned about the quality again. if you guys know any activex control that can print TIFF image please do let me know. I suppose TIFF images have higher quality.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Accepted Solution

by:
rspahitz earned 60 total points
ID: 7174822
Actually, similar questions to this have come up several times.  The answer always seems to lead to one thing:  VB prints the picture that is has in memory; Photoshop and other tools seem to manipulate the picture to try to optimize it for the printer.  This interpolation process usually does a good job of making a picture appear nicer than it really is.

In VB, if you load a picture, full-size, into a picturebox, then print it to a printer, full-size, you will get an exact printout of the picture.  The only problem is that what you see on the screen may not really be the actual picture because VB normally displays things in twips rather than pixels, and if your monitor is not configured to exactly handle the image, Windows will do some image manipulation to try to figure out how to tell the monitor to display the image.

That is, if you have an image that is one pixel by one pixel, you will not necessarily see one pixel on the monitor.  That's because Windows interprets this pixel as twips (with 20 twips per point/1440 twips per inch, and normally either 15 or 20 pixels per inch depending on your font-size settings.)  With this translation process, the pixel image may actually show up as several monitor pixels.  This allows the screen picture to appear nice, but when you print it the result may appear slightly different.

--
Aside from that, you also get the issue of light sources.  Monitors use the additive process of light, which makes green plus blue plus red mix to make white.  Printouts use the subtractive process of light, which makes green plus cyan plus magenta mix to make black.  This results in some possible translation issues when going from a colored screen pixels to a printed pixel.

At this point, I don't know if any of the above helps, so I'll stop rambling on.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 7175966
My guess on the difference in quality while printing has to do with the DPI resolution of the image.  You might think that the visual display would be equal in resolution to the DPI but it is not.  You can have two images with very different print quality that appear the same on the screen, because the screen is actually much lower resolution than the printer.

TIFF format tends to be much higher quality because no compression is performed on the image, therefore no graphical data is lost.  However, the files tend to be very large.

There are a ton of graphical OCXs on the market, but I don't know of one specific one to recommend.

There is a replacement for the VB Printer object called VSView from ComponentOne (www.componentone.com) formerly called VideoSoft.  The VSView control allows you to format reports which can include pictures, graphics (lines, circles etc), text.  It lets you rotate fonts, add colors, whatever, and then you can print-preview it, and then send to the printer.  I don't know if it would give you any better quality than the VB Printer object, buy you can probably download a Free demo version from the website and try it out.  It's good for a lot of stuff besides, so, it's worth it in my opinion.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8032026
Hi tppradeep18,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept rspahitz's comment(s) as an answer.

tppradeep18, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8095599
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

615 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