Solved

Printing high Quality Pictures through Visual Basic

Posted on 2002-07-15
9
359 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
ID: 7153812
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
ID: 7153843
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
ID: 7153970
In VB, are you using printer.PaintPicture to print yopur images?
0
 
LVL 1

Author Comment

by:loveneesh_bansal
ID: 7154186
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:inthedark
ID: 7168473
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
ID: 7168773
Hi inthedark

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

Bye
loveneesh bansal
0
 
LVL 17

Expert Comment

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

Expert Comment

by:DanRollins
ID: 8012214
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
ID: 8096015
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

930 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

12 Experts available now in Live!

Get 1:1 Help Now