Aurigma Forums
»
Legacy Products
»
Archive
»
Other Products
»
PrintForm doesn't print BitmapViewer-Objects
Rank: Member
Groups: Member
Joined: 8/24/2004(UTC) Posts: 2
|
Hi,
i sample with the GraphicsMill 2.0 Controls at the moment and i have a problem, printing screenshots with the PrintForm-Method of a Form-Object in Vb 6 (SP4).
Does anybody know, why the PrintForm-Method doesn't print the images which are shown in the BitmapVierew-Control ?
Thank you for reading this thread and hopefully for your help.
Greetings
Holger
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration Joined: 8/2/2003(UTC) Posts: 876
Thanks: 2 times Was thanked: 27 time(s) in 27 post(s)
|
Hi Holder, Could you post a code sample (or submit case with it)? Edited by user Friday, May 23, 2008 3:52:34 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Member
Joined: 8/24/2004(UTC) Posts: 2
|
Hallo, thank you for your help. Here is a very simple code example. Place a BitmapViewer-Control on an empty Form and copy the following code: Code:Private Sub Form_Load()
Call BitmapViewer1.Bitmap.LoadThumbnailFromFile("c:\arttrade\bilder\uhren\11148.jpg", 100, 100)
Me.PrintForm
End Sub
The Print-Out will show an empty Form. After printing, the image in the BitmapViewer isn't drawn correctly. Hope you can reconstruct the Problem. Thank you. Holger Edited by user Monday, December 24, 2007 5:01:10 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration Joined: 8/2/2003(UTC) Posts: 876
Thanks: 2 times Was thanked: 27 time(s) in 27 post(s)
|
It seems BitmapViewer does not support some interface or do not handle some event that allows being printed along other controls with PrintForm method. As a workaround, you can make a screenshot of the window programmatically and print it with Printer object. To do it, you should: download screen capture code sample first. Insert its functions into your project (e.g. as a separate module for convenience). Do not forget about WinAPI imports in the beginning. After that the form can be printed with the following code: Code: Dim pict As StdPicture
Set pict = CaptureActiveWindow
Picture1.Picture = pict
Printer.PaintPicture pict, 0, 0
Printer.EndDoc
Note, as this code prints actual screenshot, you cannot call it from Form_Load event handler (because form has not been created yet and it will print content of the windows behind of this form). You should do it by button click or something like this. Hope this helps. Edited by user Monday, December 24, 2007 5:01:24 PM(UTC)
| Reason: Not specified
|
|
|
|
Aurigma Forums
»
Legacy Products
»
Archive
»
Other Products
»
PrintForm doesn't print BitmapViewer-Objects
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.