Solved

Printing high Quality Pictures through Visual Basic

Posted on 2002-07-15
9
358 Views
Last Modified: 2013-11-25
Hi Experts

I have to print jpeg pictures through visual basic. It is printing very fine. But the major prob is when i am printing the image i not getting the quality as i am getting through photoshop. Second problem is that in visual basic the picture size is comming ok but in photoshop it is comming in small size. why it is happening.

Any help will be higly appreciable.

loveneesh
0
Comment
Question by:loveneesh_bansal
9 Comments
 
LVL 17

Accepted Solution

by:
inthedark earned 200 total points
Comment Utility
The problem is that you printer can print at a greater definition to your screen. For example you have an image say 800*600 pixels.  Your printer can print at say 800 dots per inch and so could print this picture at a resolution of 6400*4800.  So the Photoshop software has to expand the image from to 480000 to 30720000 pixels. When it does this it uses clever software which kinda generates (guesses) at detail that is not really there.

To improve the way that you VB print routine is working and make sure that you are loading the image with its maximum possible resolution:

So use an image control with the stretch attribute.  Set the image to have the same number of pixels as the print area you wish to fill:

fullwidth = printer.scalewidth-printer.scaleleft
image1.stretch=true
image1.width = fullwidth
image1.height = fullwidth * h/w ' maintain height/width ratio
image1.picture=loadpicture(PicturePath)
(where h & w are picture's dimensions)





0
 
LVL 1

Author Comment

by:loveneesh_bansal
Comment Utility
Hi inthedark

Thanks for your kind reply. But i am not getting what you are saying. Actually i elaborate my proble more. I am trying to generate an Icard system. Here i am using the printer object directly. I am printing 8 records per page with the image of each user. that is 8 images a page. I am resizing my image through photoshop already. But i am not gettign the actual quality. Is there any way to get the same.

With Regards
Lovenesh bansal
0
 
LVL 17

Expert Comment

by:inthedark
Comment Utility
In VB, are you using printer.PaintPicture to print yopur images?
0
 
LVL 1

Author Comment

by:loveneesh_bansal
Comment Utility
yes i am using printer.PaintPicture. Is there any way that i store my images into the database or the path of the image into the database then call the same through crystal report.

any help

With Regards
loveneesh bansal
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 17

Expert Comment

by:inthedark
Comment Utility
You can store your picture in a database using the OLE Object data type.

I think that you can drag this field onto your report, (although I have only printed Images within Access reports, I'm sure it works).

You can experiment by copy/paste a picture into an OLE Object field. You can only vierw the picture if it has been placed on a form.
0
 
LVL 1

Author Comment

by:loveneesh_bansal
Comment Utility
Hi inthedark

I have done the same thing but not getting the image quality.

Bye
loveneesh bansal
0
 
LVL 17

Expert Comment

by:inthedark
Comment Utility
Paste the code you are using to print the pircure.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi loveneesh_bansal,
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 inthedark's comment(s) as an answer.

loveneesh_bansal, 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.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now