Extracts the bitmap context from device context 
Author Message
 Extracts the bitmap context from device context

Hi,

Is it possible to extract all the bitmap bits using a
device context in VB.Net? For example, if I have a picture
box on a form and I put a picture inside the picture box,
can I get the device context from the picture box by
calling picturebox1.CreateGraphics().GetHdc() and get the
bitmap bits of that picture using the device context? It
would be great if you can show me an example.

The reason I want to do this is to compare two images in
two different program programmtically. I want to compare
the bitmap bits located inside the memory.

(it's quite ugent!)

Thank you very much.

Tim



Sun, 18 Jul 2004 12:19:15 GMT  
 Extracts the bitmap context from device context
what you could do is first load the bitmap in memory and second copy it to
the picturebox

dim Bm as new Bitmap("c:\bitmap.bmp")
Dim G as graphics
G= graphics.fromimage(bm)
PictureBox1.CreateGraphics.DrawImage(G, 0, 0)

now you have the bitmap to compare stored in Bm


Quote:
> Hi,

> Is it possible to extract all the bitmap bits using a
> device context in VB.Net? For example, if I have a picture
> box on a form and I put a picture inside the picture box,
> can I get the device context from the picture box by
> calling picturebox1.CreateGraphics().GetHdc() and get the
> bitmap bits of that picture using the device context? It
> would be great if you can show me an example.

> The reason I want to do this is to compare two images in
> two different program programmtically. I want to compare
> the bitmap bits located inside the memory.

> (it's quite ugent!)

> Thank you very much.

> Tim



Sun, 18 Jul 2004 20:33:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Bitmap device context problem

2. How to get a bitmap from a device context

3. Disable context menu or close context menu

4. Printer Device Context Handle for old ActiveX control

5. Graphics - Device Context

6. Graphics -> Device Context

7. BMP without a device context

8. Print Device Context in VB

9. Getting a Device Context in VB for Win CE

10. Device Context Handle - PLEASE HELP

11. Need byte array ==> Device Context routine

12. Device Context: I just want do know!

 

 
Powered by phpBB® Forum Software