killRoy
August 14th, 2001, 10:42 AM
By the way, I hate converting VB 3.0 to 6.0 :)
Can anyone tell me how I can print a bitmap that exists on a form in my app to a specified location on a page? This is the code I have so far (pardon the lack of Dims, I didn't think they were necessary):
lf.lfHeight = yfntSm%
lf.lfWidth = xFntSm%
lf.lfEscapement = 0 ' normal
lf.lfWeight = 400
lf.lfFaceName = "Times New Roman" + Chr$(0)
lf.lfOutPrecision = OUT_DEFAULT_PRECIS
lf.lfClipPrecision = OUT_DEFAULT_PRECIS
lf.lfQuality = DEFAULT_QUALITY
lf.lfPitchAndFamily = DEFAULT_PITCH Or FF_DONTCARE
lf.lfCharSet = DEFAULT_CHARSET
hFont = CreateFontIndirect(lf) 'Create the font
di.cbSize = 20 ' Size of DOCINFO structure
di.lpszDocName = "My Document" ' Set name of print job (Optional)
Printer.TrackDefault = true 'Use default printer
hPrintDC = CreateDC(Printer.DriverName, Printer.DeviceName, 0, 0)
result = StartDoc(hPrintDC, di) 'Start a new print document
result = StartPage(hPrintDC) 'Start a new page
' Select our font structure and save previous font info
hOldfont = SelectObject(hPrintDC, hFont)
' Print some sample text
result = TextOut(hPrintDC, 1000, 1000, "Hello World", 11)
(Right here, I'd like to print frmSig!picSignature, which is a PictureBox, to the page. How do I do that!??)
result = EndPage(hPrintDC) 'End the page
result = EndDoc(hPrintDC) 'End the print job
result = DeleteDC(hPrintDC) 'Delete the printer device context
result = DeleteObject(hFont) 'Delete the font object
I'm interfacing with various DLLs to access the Windows API, but I don't know which functions in the API that I need to print the bitmap. Any suggestions would be great!
Thank you!!
killRoy
Can anyone tell me how I can print a bitmap that exists on a form in my app to a specified location on a page? This is the code I have so far (pardon the lack of Dims, I didn't think they were necessary):
lf.lfHeight = yfntSm%
lf.lfWidth = xFntSm%
lf.lfEscapement = 0 ' normal
lf.lfWeight = 400
lf.lfFaceName = "Times New Roman" + Chr$(0)
lf.lfOutPrecision = OUT_DEFAULT_PRECIS
lf.lfClipPrecision = OUT_DEFAULT_PRECIS
lf.lfQuality = DEFAULT_QUALITY
lf.lfPitchAndFamily = DEFAULT_PITCH Or FF_DONTCARE
lf.lfCharSet = DEFAULT_CHARSET
hFont = CreateFontIndirect(lf) 'Create the font
di.cbSize = 20 ' Size of DOCINFO structure
di.lpszDocName = "My Document" ' Set name of print job (Optional)
Printer.TrackDefault = true 'Use default printer
hPrintDC = CreateDC(Printer.DriverName, Printer.DeviceName, 0, 0)
result = StartDoc(hPrintDC, di) 'Start a new print document
result = StartPage(hPrintDC) 'Start a new page
' Select our font structure and save previous font info
hOldfont = SelectObject(hPrintDC, hFont)
' Print some sample text
result = TextOut(hPrintDC, 1000, 1000, "Hello World", 11)
(Right here, I'd like to print frmSig!picSignature, which is a PictureBox, to the page. How do I do that!??)
result = EndPage(hPrintDC) 'End the page
result = EndDoc(hPrintDC) 'End the print job
result = DeleteDC(hPrintDC) 'Delete the printer device context
result = DeleteObject(hFont) 'Delete the font object
I'm interfacing with various DLLs to access the Windows API, but I don't know which functions in the API that I need to print the bitmap. Any suggestions would be great!
Thank you!!
killRoy