How to Handle 32-bit Bitmap Images in The Imaging Toolkits

How to Handle 32-bit Bitmap Images in The Imaging Toolkits

1

How to Print Annotations Programmatically with Document Imaging OCXs

1

Printing Tip: How to Create a Silent MSI Printer Driver Install for Vista

2

Printing Tip: How to Modify the Driver File Names for an MSI Install

3

How to Print Annotations Programmatically
with Document Imaging OCXs

Black Ice Software

January, 2008

Volume 13, Issue 1

Dim method As Short = 0
Dim intensity As Integer = 0
Dim hdib1 As Integer = 0
Dim hdib2 As Integer = 0
Dim testFile As String = "test.bmp"
Dim outFile As String = "out.bmp"

 

' if the source file is 32-bit convert it to 24-bit
If AxBIDIB1.GetBMPBitDepth(testFile) = 32 Then
   Dim hDib32 As Integer
   hDib32 = AxBIDIB1.Load32BitDIB(testFile)
   If hDib32 > 0 Then
      ' convert the 32-bit DIB to 24-bit DIB
      hdib1 = AxBIDIB1.Convert32BitDIBTo24Bit(hDib32)
      AxBIDIB1.DropDIB(hDib32)
   Else
      hdib1 = 0
   End If
Else
   hdib1 = AxBIDIB1.LoadDIBFromFile(testFile)
End If

 

' halftone
hdib2 = AxBIDIB1.Halftone(hdib1, method, intensity)

' save the converted image

AxBIDIB1.SaveDIBInImageFormat(outFile, hdib2, 0, 6, 201)

 

' release the memory

AxBIDIB1.DropDIB(hdib1) 

AxBIDIB1.DropDIB(hdib2)

January Developer News