Problem using Printer.PaintPicture with wmf files
Posted on 2010-09-21
We create our wmf files using PowerPoint vbscript (Slide.Export to wmf). In particular these slides may contain pictures (clipart) which extend beyond the slide's frame. In other words, a portion of the clipart is within the slide’s borders -- the rest is outside of the frame but viewable in PowerPoint’s editor.
When opening these wmf files using Paint, Windows Picture and Fax Viewer, or Microsoft Office Picture Manager, the wmf is displayed correctly -- all the content within the slide’s frame is visble – any content outside the frame is obscured.
Now, in our standalone VB6 Windows form application, we load the wmf files using the following code (Image1 is an Image component within our form)
Image1.Picture = LoadPicture("c:\sample.wmf")
When we attempt print the image, using the following code
Printer.PaintPicture Image1.Picture, 0, 0 (Printer could be pointing to any printer)
the printout shows all of the content, including the portion of the pictures which were supposed to be obscured. I had attempted to use PictureBox component instead of an Image component but Printer.PaintPicture still prints all of the content.
I need to print just what’s inside of the slide’s frame. Any thoughts?