SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Displays/prints a device dependent bitmap.
VB.NET | object.PrintDDB(ByVal BitmapHandle As Integer, ByVal PrinterDC As Integer, ByVal XPrinterPix As OLE_XPOS_PIXELS, ByVal YPrinterPix As OLE_XPOS_PIXELS, ByVal WPrinterPix As OLE_XSIZE_PIXELS, ByVal HPrinterPix As OLE_YSIZE_PIXELS, ByVal WDispPix As Integer, ByVal HDispPix As Integer) |
VB | object.PrintDDB(ByVal BitmapHandle As Long, ByVal PrinterDC As Long, ByVal XPrinterPix As OLE_XPOS_PIXELS, ByVal YPrinterPix As OLE_XPOS_PIXELS, ByVal WPrinterPix As OLE_XSIZE_PIXELS, ByVal HPrinterPix As OLE_YSIZE_PIXELS, ByVal WDispPix As Long, ByVal HDispPix As Long) |
C#.NET | void object.PrintDDB(int BitmapHandle, int PrinterDC, OLE_XPOS_PIXELS XPrinterPix, OLE_XPOS_PIXELS YPrinterPix, OLE_XSIZE_PIXELS WPrinterPix, OLE_YSIZE_PIXELS HPrinterPix, int WDispPix, int HDispPix); |
VC++ | HRESULT object->PrintDDB(long BitmapHandle, long PrinterDC, OLE_XPOS_PIXELS XPrinterPix, OLE_XPOS_PIXELS YPrinterPix, OLE_XSIZE_PIXELS WPrinterPix, OLE_YSIZE_PIXELS HPrinterPix, long WDispPix, long HDispPix); |
C | HRESULT object->raw_PrintDDB(long BitmapHandle, long PrinterDC, OLE_XPOS_PIXELS XPrinterPix, OLE_XPOS_PIXELS YPrinterPix, OLE_XSIZE_PIXELS WPrinterPix, OLE_YSIZE_PIXELS HPrinterPix, long WDispPix, long HDispPix); |
object
BitmapHandle
The bitmap handle of the bitmap to be printed.
PrinterDC
The printer device context.
XPrinterPix
The horizontal offset in printer coordinates, where the bitmap is printed.
YPrinterPix
The vertical offset in printer coordinates, where the bitmap is printed.
WPrinterPix
The width of the printed bitmap (in printer coordinates).
HPrinterPix
The height of the printed bitmap (in printer coordinates).
WDispPix
The width of the bitmap (in pixels, screen coordinates).
HDispPix
The height of the bitmap (in pixels, screen coordinates).
The PrintDDB method displays/prints a device dependent bitmap.
This method is not supported for use with Visual Basic 6.0
Device dependent bitmaps (screen bitmaps) can be printed using the PrintDDB method. Screen bitmaps cannot usually be printed without losing their original size (e.g., using BitBlt). The PrintDDB method is used to print bitmaps instead. When printing a screen bitmap, the width and height of the bitmap need to be scaled to retain their approximate original dimensions once printed.
The GetDDBSize method retrieves the display and print size of a device dependent bitmap.
Dim hBmp As IntPtr = bmp.GetHbitmap() AxSftPrintPreview1.GetDDBSize(hBmp.ToInt32(), AxSftPrintPreview1.RenderingInfo.hDC, wPrinterPix, hPrinterPix, wDispPix, hDispPix) ' make sure entire image fits on remaining page If yPrinter + hPrinterPix > outRect.Bottom Then DeleteObject(hBmp) Exit While End If ' print bitmap, horizontally centered AxSftPrintPreview1.PrintDDB(hBmp.ToInt32(), AxSftPrintPreview1.RenderingInfo.hDC, xPrinter + (outRect.Width - wPrinterPix) / 2, _ yPrinter, wPrinterPix, hPrinterPix, wDispPix, hDispPix) DeleteObject(hBmp) yPrinter += hPrinterPix ' next available space Else ' Print line ' get text size Dim s As SizeF = g.MeasureString(m_DrawText, m_PrintFont)
IntPtr hBmp = bmp.GetHbitmap(); axSftPrintPreview1.GetDDBSize((int) hBmp, (int) axSftPrintPreview1.RenderingInfo.hDC, out wPrinterPix, out hPrinterPix, out wDispPix, out hDispPix); // make sure entire image fits on remaining page if (yPrinter + hPrinterPix > outRect.Bottom) { DeleteObject(hBmp); break; } // print bitmap, horizontally centered axSftPrintPreview1.PrintDDB((int) hBmp, axSftPrintPreview1.RenderingInfo.hDC, xPrinter +(outRect.Width-wPrinterPix)/2, yPrinter, wPrinterPix, hPrinterPix, wDispPix, hDispPix); DeleteObject(hBmp); yPrinter += hPrinterPix; // next available space } else { // Print line
// get bitmap size long wPrinterPix, hPrinterPix, wDispPix, hDispPix; m_vPrintPreview1->GetDDBSize((long)(HBITMAP)m_BitmapPage, RenderInfo.hDCPrinter, &wPrinterPix, &hPrinterPix, &wDispPix, &hDispPix); // make sure entire image fits on remaining page if (yPrinter + hPrinterPix > outRect.bottom) break; // print bitmap, horizontally centered m_vPrintPreview1->PrintDDB((long)(HBITMAP)m_BitmapPage, (long) pDC->m_hDC, xPrinter +((outRect.right-outRect.left)-wPrinterPix)/2, yPrinter, wPrinterPix, hPrinterPix, wDispPix, hDispPix); yPrinter += hPrinterPix; // next available space } else { // Print line // get text size RECT rect;
See Also SftPrintPreview Object | Object Hierarchy