Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Picture Measurement Units for Print

Posted on 2004-03-30
3
Medium Priority
?
1,333 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 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
Viewers will learn how to use the Hootsuite Dashboard.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

916 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