Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing high Quality Pictures through Visual Basic

Posted on 2002-07-15
9
Medium Priority
?
366 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
[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
9 Comments
 
LVL 17

Accepted Solution

by:
inthedark earned 800 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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
 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses

718 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