?
Solved

HELP!! **Printing Graphics**

Posted on 1998-11-10
5
Medium Priority
?
180 Views
Last Modified: 2013-11-13
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!
0
Comment
Question by:econy1
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 100 total points
ID: 1444162
You need to load the graphic into an image box or picture box and then

Printer.PaintPicture image1.Image, X, Y


0
 

Author Comment

by:econy1
ID: 1444163
okay, i thought of doing this.
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.).
0
 

Author Comment

by:econy1
ID: 1444164
also...
in VB5, is it still image1.image, or image1.picture   ?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1444165
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.

0
 

Author Comment

by:econy1
ID: 1444166
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.  
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

568 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