Solved

Picture Measurement Units for Print

Posted on 2004-03-30
3
1,311 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
  • 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 250 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

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

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 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

18 Experts available now in Live!

Get 1:1 Help Now