Re: Text and Graphics to Dot Matrix Printer???

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mike D Sutton _at_ Work (_at_)
Date: 02/24/04


Date: Tue, 24 Feb 2004 14:43:18 -0000


> I need to print to a Dot Matrix Printer (panasonic Kx-P1150) some text and a
> barcode (image into a picture box).
>
> The way I tried is using Win32 API to print the raw text and then switch to graphics using
> windows printer driver. I would like to print the barcode which is an image into picture
> box using the same API calls and avoid the use of Visual Basic Printer object.
>
> The problem I have with the printer object is that once you send a "Printer.EndDoc"
> the printer will issue a form feed command. Are there any suggestions?

Presumably when you're drawing the text to the printer, you're using something like TextOut() or DrawText() to draw it to the
printer's device context? If so then you can simply use the BitBlt() or StretchBlt() API call's to draw your picture from the
picture box in VB onto the printer's device context. If that's no help then you may wish to re-post to a GDI group such as
microsoft.public.win32.programmer.gdi where you'll get more assistance on the printing side of things using the GDI API.
Hope this helps,

    Mike

 - Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: http://www.mvps.org/EDais/



Relevant Pages

  • Re: Dialog Boxes in PowerPoint
    ... Here's a bit of code that is based on Shyam's example of the Sleep api ... It opens the Insert Picture from File dialogue and hangs out ... Dim lShapeCount As Long ... Dim i As Integer, j As Integer ...
    (microsoft.public.powerpoint)
  • Re: Modifying A Pixel in a Pictures color
    ... BTW, very nice site Mike. ... then you won't be able to use the VB picture box anyway ... >> and you'll have to use the various API methods. ...
    (microsoft.public.vb.general.discussion)
  • GDI+ questions
    ... I'm using GDI+ api to draw a day time planning into a picture, it's great, ... I have one problem, 90% of the time, I don't need to redraw all the picture, ...
    (microsoft.public.vb.winapi.graphics)
  • Re: event before autoredraw
    ... > Basic displays the drawing displaced. ... DLL source code wouldn't help I'm afraid. ... but if, for example, you are setting the picture box Autoredraw to True ... The SetViewPointOrgEx API function that you are using (as I'm sure you ...
    (comp.lang.basic.visual.misc)
  • Re: PaintPicture with Printer Object in VB ver 6
    ... ' so far works fine, next bar code, doesn't print ... MsgBox "Printing exceeded printer width" ... 'the later lines should proceed with x initialized, y incremented by barcode ... >> the page is still empty, and the height and width of the first picture is ...
    (microsoft.public.vb.general.discussion)