<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : [QUESTION] PrintPreview Using BitBlt</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : [QUESTION] PrintPreview Using BitBlt]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 22 May 2026 06:14:33 +0000</pubDate>
  <lastBuildDate>Wed, 19 Jan 2011 08:15:15 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=17793</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[[QUESTION] PrintPreview Using BitBlt : Hi,Just thought I would say that...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17793&amp;PID=62250&amp;title=question-printpreview-using-bitblt#62250</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 17793<br /><strong>Posted:</strong> 19 January 2011 at 8:15am<br /><br />Hi,<br><br>Just thought I would say that using the code above has resolved my print and export to pdf issue. However I can only seem to use the PrintPreview using BitBlt... unless anyone knows a way of displaying an image from a PictureBox on the PrintPreview and would like to share! <br><br>All these views and not a peep <img src="http://forum.codejock.com/smileys/smiley5.gif" border="0" alt="C&#111;nfused" title="C&#111;nfused" /><br>]]>
   </description>
   <pubDate>Wed, 19 Jan 2011 08:15:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17793&amp;PID=62250&amp;title=question-printpreview-using-bitblt#62250</guid>
  </item> 
  <item>
   <title><![CDATA[[QUESTION] PrintPreview Using BitBlt :       Hi,I am currently...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17793&amp;PID=62239&amp;title=question-printpreview-using-bitblt#62239</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 17793<br /><strong>Posted:</strong> 18 January 2011 at 9:20am<br /><br />Hi,<br><br>I am currently designing an MDI application that displays a report that uses a Resizer Control to house a PictureBox control as a container for several controls, which include Labels, ReportControl and Barcodes.<br><br>As you can see from the attached screenshot <b>Figure 1</b> <i>(costs blanked for obvious reasons) </i>I have this working as I wish. However a requirement I have is to Print, Print Preview and Export to PDF all of which I have managed to do using BitBlt to get a snapshot of the PictureBox Container.<br><br><img src="uploads/2960/PrintPreview_using_BitBlt.png" height="1536" width="960" border="0" /><br><font size="1">Figure 1</font><br><br>If the program is on a laptop or screen with a smaller resolution the resizer control correctly shows the scrollbars, however then I have an issue with the Print, Print Preview and Export to PDF... see attached screenshot <b>Figure 2. </b>Although this is an issue, most users here have 19" Monitors therefore should never have this issue, but it would be good to resolve this.<br><b><br></b><b><img src="uploads/2960/PrintPreview_using_BitBlt_Issue.png" height="768" width="959" border="0" /></b><br><font size="1">Figure 2</font><b><br><br></b>Does anyone know of a way of Printing and Previewing a PictureBox container that contains several different type of controls?<b> </b>Due to the PictureBox being larger than the hidden area it is not painting the controls, instead this is painting what is on top of the hidden area of the PictureBox!<b><br><br></b>Any help would be appreciated. Also I would be willing to upload the code that does the Print, PrintPreview &amp; Export to PDF if requested. Though I would need to code this into a Sample application, when I get some free time. <b><br><br></b>I have resolved this for both Printing and Exporting to PDF using the example code below however I need to see if I can get this to work with the Codejock PrintPreview control:<span style="font-weight: bold;"></span><b><span style="font-weight: bold;"></span></b><b><br></b><b><br></b><table width="99%"><tr><td><pre class="BBcode"><br>Private Declare Function SendMessage Lib "user32.dll" Alias _<br>&nbsp;&nbsp; "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _<br>&nbsp;&nbsp; ByVal wParam As Long, ByVal lParam As Long) As Long<br><br>Private Const WM_PAINT = &amp;HF<br>Private Const WM_PRINT = &amp;H317<br>Private Const PRF_CLIENT = &amp;H4&amp;&nbsp;&nbsp;&nbsp; ' Draw the window's client area<br>Private Const PRF_CHILDREN = &amp;H10&amp; ' Draw all visible child<br>Private Const PRF_OWNED = &amp;H20&amp;&nbsp;&nbsp;&nbsp; ' Draw all owned windows<br><br>Private Sub Command1_Click()<br>&nbsp;&nbsp;&nbsp; Dim rv As Long<br>&nbsp;&nbsp;&nbsp; Dim ar As Boolean<br><br>&nbsp;&nbsp;&nbsp; With Picture1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Save ReDraw value<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ar = .AutoRedraw<br>&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Set persistance<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AutoRedraw = True<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Draw controls to picture box<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rv = SendMessage(.hwnd, WM_PAINT, .hDC, 0)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rv = SendMessage(.hwnd, WM_PRINT, .hDC, PRF_CHILDREN Or PRF_CLIENT Or PRF_OWNED)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Refresh image to picture property<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Picture = .Image<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Copy picture to Printer<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .PaintPicture .Picture, .Width, .Height<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Enable the Lines below to reset the PictureBox painted picture after use<br>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Restore backcolor&nbsp; (Re-load picture if picture was used)<br>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Picture1.Line (0, 0)-(.ScaleWidth, .ScaleHeight), .BackColor, BF<br>'<br>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Restore ReDraw<br>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AutoRedraw = ar<br>&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp; <br>End Sub<br></pre></td></tr></table><b><br></b>]]>
   </description>
   <pubDate>Tue, 18 Jan 2011 09:20:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17793&amp;PID=62239&amp;title=question-printpreview-using-bitblt#62239</guid>
  </item> 
 </channel>
</rss>