Solved

Picture Measurement Units for Print

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

Highfive Gives IT Their Time Back

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!

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.

760 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

20 Experts available now in Live!

Get 1:1 Help Now