joe_pool_is Posted April 29, 2008 Posted April 29, 2008 We have a control that is available in an SDK called LabelImage that is defined as follows (providing I don't fat finger anything):Object. LabelImage Long hWindow, [boolean bPrintPreview] Parameters hWindow is the handle of the window on which the label image will be painted; Optional. bPrintPreview is a boolean indicating if all the field's values should be shown when creating the image, as in the case of preview on LabelView QuickPrint window. Remarks Paints the current label's image on the user's window. Return Values If the label image is painted successfully, the return value is True, otherwise it is False.I want to paint this into a PictureBox control so that I can preview it prior to printing. In VB 2005, I have passed the method defined above the PictureBox's Handle as followsCode: obj.LabelImage(PictureBox1.Handle()) ' Handle returns an IntPtr The LabelImage returns True, but still no image. I tried overloading the OnPaint usingCode: Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) and the e.Graphics.IsClipEmpty property is False. So, how do I use the PaintEventArgs to populate PictureBox1? Quote Avoid Sears Home Improvement
Administrators PlausiblyDamp Posted May 5, 2008 Administrators Posted May 5, 2008 If you try passing in PictureBox1.Handle.ToInt32 instead does that make a difference? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
joe_pool_is Posted May 6, 2008 Author Posted May 6, 2008 That worked. Thank you! Sorry for taking so long to get back with you on this, but we had other fires burning at work, and this got pushed to the back. Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.