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

x
?
Solved

Picture Measurement Units for Print

Posted on 2004-03-30
3
Medium Priority
?
1,329 Views
Last Modified: 2013-11-15
Hello Experts!

I have written a thumnail generator for my picture library using StdPicture to load the pictures and then painting them to a PictureBox.

I now need to be able to print them out at a selected size, ie to fit A4 or A5 size.

I dont know the relationship between the STDPicture.Width and .Height and the Printer.PaintPicture loadpicture("MyFile.JPG"), xxx, xxx units to be able to figure out a ratio for printing them in proportion.

What would i have to put in where the xxx's are to make it print to A5 (148mm x 210mm) Size for example?

Sorry if it's a bit unclear and thanks in advance,

Bobeo
0
Comment
Question by:Bobeo
[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
  • 2
3 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 10713440
You could convert..
Printer.PaintPicture loadpicture("MyFile.JPG"), printer.ScaleX(picture1.scalewidth,picture1.scale,printer.Scale),printer.Scaley(picture1.scaleheight,picture1.scale,printer.Scale)
0
 
LVL 13

Accepted Solution

by:
crazyman earned 1000 total points
ID: 10713471


Use the PaintPicture Method

Draws the contents of a graphics file (.bmp, .wmf, .emf, .ico, or .dib) on a Form, PictureBox, or Printer. Doesn't support named arguments.

Syntax

object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode

The PaintPicture method syntax has these parts:

Part     Description
object     Optional. An object expression that evaluates to an object in the Applies To list. If object is omitted, the Form object with the focus is assumed to be object.
Picture     Required. The source of the graphic to be drawn onto object. Must be the Picture property of a Form or PictureBox.
x1, y1     Required. Single-precision values indicating the destination coordinates (x-axis and y-axis) on object for picture to be drawn. The ScaleMode property of object determines the unit of measure used.
Width1     Optional. Single-precision value indicating the destination width of picture. The ScaleMode property of object determines the unit of measure used. If the destination width is larger or smaller than the source width (width2), picture is stretched or compressed to fit. If omitted, the source width is used.
Height1     Optional. Single-precision value indicating the destination height of picture. The ScaleMode property of object determines the unit of measure used. If the destination height is larger or smaller than the source height (height2), picture is stretched or compressed to fit. If omitted, the source height is used.
x2, y2     Optional. Single-precision values indicating the coordinates (x-axis and y-axis) of a clipping region within picture. The ScaleMode property of object determines the unit of measure used. If omitted, 0 is assumed.
Width2     Optional. Single-precision value indicating the source width of a clipping region within picture. The ScaleMode property of object determines the unit of measure used. If omitted, the entire source width is used.
Height2     Optional. Single-precision value indicating the source height of a clipping region within picture. The ScaleMode property of object determines the unit of measure used. If omitted, the entire source height is used.
Opcode     Optional. Long value or code that is used only with bitmaps. It defines a bit-wise operation (such as vbMergeCopy or vbSrcAnd) that is performed on picture as it's drawn on object. For a complete list of bit-wise operator constants, see the RasterOp Constants topic in Visual Basic Help.
 
 

See http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_10128496.html?query=printing+scale+picture&searchType=topic
0
 
LVL 3

Author Comment

by:Bobeo
ID: 10713575
Superb Crazyman!

Got it sorted.

Thanks for your help.

Bobeo
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
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

661 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