|
-
November 22nd, 1999, 10:38 AM
#1
DIB Handle in VB?
Hi all,
Does anyone know how VB can use a handle to a DIB? My VB app gets a DIB handle back from a DLL which in turn scans an image on a scanner. My ultimate goal is to just print the image; I don't even need to display it (but I can if it makes it easier). Problem is, I don't know how VB can make use of a handle like that.
Any help is greatly appreciated,
Mike
-
November 23rd, 1999, 04:40 AM
#2
Re: DIB Handle in VB?
This is just an idea, ok.. even i am not sure if it works.
How abt blitting the DIB bitmap directly into the DC of a Picturebox with an API call like BitBlt? If it works then you can replace the Picturebox DC with the hdc of Printer object ,and in most cases they are interchangabe, you should be able to print it.
You could also check how the API fn GetObject reacts to this handle (in Vb code itself), it may give you a bitmap handle which you can then use to blit the image to a dc.
Tell me if if works.. and if it doesn't work also:-)
RK
-
November 24th, 1999, 08:41 AM
#3
Re: DIB Handle in VB?
Yup, BitBlting to the DC of a PictureBox control works. Unfortunately, the bitmap started off monochrome, but after I BitBlted it to the PictureBox it became 24-bit, which wasn't what I wanted. I couldn't find a way to go from 24-bpp to 1-bpp easily, which has been my dilema all along. I finally had to take a hack on this problem, which I hate doing.
Thanks for the suggestion though, much appreciated!
Mike
-
November 24th, 1999, 08:45 AM
#4
Re: DIB Handle in VB?
Oh yeah, just for some clarification, it's not a real printer, it's an Adode PDF Writer printer. We need to use monochrome for space considerations. We have literally hundreds of thousands of these PDF files to store, and 50k beats 500k any day We don't need it in color to be able to read it.
Later,
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|