Solved

Picture Measurement Units for Print

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Software for Local History Museum Library 5 90
exchange 2016 suddenly stopped working 15 102
Computer Virus 30 76
Create a list of Worksheets based on Cell Value 14 32
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

751 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