econy1
asked on
HELP!! **Printing Graphics**
I need QUICK help!!!
I need to be able to print graphics (.bmp) files to the printer, and have no idea how...
For example, my output needs to look something like this:
[text]
[graphic1.bmp] [graphic2.bmp] [graphic3.bmp] ...
[text]
[graphic2.bmp] [graphic3.bmp] [graphic1.bmp] ...
ETC...
Thanks!
I need to be able to print graphics (.bmp) files to the printer, and have no idea how...
For example, my output needs to look something like this:
[text]
[graphic1.bmp] [graphic2.bmp] [graphic3.bmp] ...
[text]
[graphic2.bmp] [graphic3.bmp] [graphic1.bmp] ...
ETC...
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
also...
in VB5, is it still image1.image, or image1.picture ?
in VB5, is it still image1.image, or image1.picture ?
You have to fiddle with the X/Y values to position the image where you want. There are 1440 Twips in one inch. So if you want the image positioned 2" in from the left and 3" down from the top you'd specify 2880, 4320. Remember there is a "dead zone" around the printer that is *added* to these numbers. 0,0 is the upper left corner and defines the limit of the dead zone.
Printer.PaintPicture Picturebox1.Image, 0, 0
Here is syntax from help:
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.
Remarks
You can flip a bitmap horizontally or vertically by using negative values for the destination height (height1) and/or the destination width (width1). You can omit as many optional trailing arguments as you want. If you omit an optional trailing argument or arguments, don't use any commas following the last argument you specify. If you want to specify an optional argument, you must specify all optional arguments that appear in the syntax before it.
Printer.PaintPicture Picturebox1.Image, 0, 0
Here is syntax from help:
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.
Remarks
You can flip a bitmap horizontally or vertically by using negative values for the destination height (height1) and/or the destination width (width1). You can omit as many optional trailing arguments as you want. If you omit an optional trailing argument or arguments, don't use any commas following the last argument you specify. If you want to specify an optional argument, you must specify all optional arguments that appear in the syntax before it.
ASKER
i guess this is the only way. it's unfortunate, because there should be an easier way. i will eventually accept your answer, but i want to leave it open just a little while longer to see if there may be an easier, more efficient way to doing this.
ASKER
now, what values go in for X and Y, so that the images print on the paper in the format i want them to (see format in original question.).