Print a Form Preview Window with pictures
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Print a Form Preview Window with pictures

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Print a Form Preview Window with pictures

    Hi,

    I have the following scenario:

    I have built a form preview using scrollbar and picturebox. Within this picture box control, I have ten other picture boxs (let's call them cards). Each card has 4 labels and two image boxes. Yes. Imagine you are printing a series of ten ID badges. Each badge has a barcode and a picture plus names, etc.

    The preview works. The problem is printing. I snatched some code from MSDN which uses SendMessage to grab the child content of a picture box. I was able to verify that each card is built correctly. I was able to use SavePicture to save each card as a bitmap and I was able to view th bitmaps.

    However, when I try to do the same with the preview picture box, all I can get was an almost empty picture with just the card pictureboxes. There is nothing inside each card.

    Any ideas, VB6 gurus?

    I don't really need the preview window, all I have trying to do is to print 10 ID Cards to the printer. Each card has a picture, a barcode bitmap and some labels.

    Using form.PrintForm is out since the form is bigger than the screen.

    I have been banging my head as to why the graphics are missing for a l-o-n-g time. Any suggestions are more than welcomed.

  2. #2
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Print a Form Preview Window with pictures

    I think you should be able to use the PaintPicture method of the printer object, to place the images wherever you want them on the paper. However, if you want to position everything on the form, and have it print a pixel-perfect copy of it, then it might be easier to use something like Set Picture1.Picture = Picture1.Image, then use PaintPicture to get that image onto the printer object. Thing is, if any of the contents is off the edge of the screen, it might complicate things.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center