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
Retrieves the display and print size of a device dependent bitmap.
VB.NET | object.GetDDBSize(ByVal BitmapHandle As Integer, ByVal PrinterDC As Integer, ByRef WPrinterPix As Integer, ByRef HPrinterPix As Integer, ByRef WDispPix As Integer, ByRef HDispPix As Integer) |
VB | object.GetDDBSize(ByVal BitmapHandle As Long, ByVal PrinterDC As Long, WPrinterPix As Long, HPrinterPix As Long, WDispPix As Long, HDispPix As Long) |
C#.NET | void object.GetDDBSize(int BitmapHandle, int PrinterDC, out int WPrinterPix, out int HPrinterPix, out int WDispPix, out int HDispPix); |
VC++ | HRESULT object->GetDDBSize(long BitmapHandle, long PrinterDC, long* WPrinterPix, long* HPrinterPix, long* WDispPix, long* HDispPix); |
C | HRESULT object->raw_GetDDBSize(long BitmapHandle, long PrinterDC, long* WPrinterPix, long* HPrinterPix, long* WDispPix, long* HDispPix); |
object
BitmapHandle
The bitmap handle of the bitmap, for which the dimensions are returned.
PrinterDC
The printer device context.
WPrinterPix
Returns the printed width of the bitmap (in pixels).
HPrinterPix
Returns the printed height of the bitmap (in pixels).
WDispPix
Returns the screen width of the bitmap (in pixels).
HDispPix
Returns the screen height of the bitmap (in pixels).
The GetDDBSize method retrieves the display and print size of 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 not 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.
If (Counter Mod (50 + 1)) = 0 Then ' Print a bitmap ' get bitmap size Dim bmp As Bitmap = New Bitmap(pictureBox1.Image) Dim wPrinterPix As Integer, hPrinterPix As Integer, wDispPix As Integer, hDispPix As Integer 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)
if ((counter % (50+1)) == 0) { // Print a bitmap // get bitmap size Bitmap bmp = new Bitmap(pictureBox1.Image); int wPrinterPix, hPrinterPix, wDispPix, hDispPix; 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,
} if ((counter % (50+1)) == 0) { // Print a bitmap // 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
See Also SftPrintPreview Object | Object Hierarchy