bitblt in .NET: ignorant but not stupid 
Author Message
 bitblt in .NET: ignorant but not stupid

I know, I know; I should show my exact code BUT (I don't
have it with me on this machine), so here is what I
remember.

I am trying to create a Bitmap object from a .bmp file and
bitblt it to a form or picturebox in VB.NET. My current
attempt results in a black image blted to the correct
position. The image is w X ht 24bpp.  My general scheme is:

Const SRCCOPY = &HCC0020
Dim destHDC As IntPtr = e.Graphics.GetHdc()
Dim myBitmap As Bitmap = New Bitmap
                   ("image.bmp")
'e.graphics.DrawImage(myBitmap, x, y) shows on form OK
Dim gSrc As Graphics = Graphics.FromImage(myBitmap)
Dim srcHDC As IntPtr = gSrc.GetHdc()
BitBlt(destHDC, x, y, w, ht, srcHDC, 0, 0, SRCCOPY)
e.Graphics.ReleaseHdc(hdc)

I don't have any problem blitting from a picture box to
the form if the image is first loaded in the picture box,
and the picturebox is visible.
I would be just as happy if someone could explain how to
allow me to blit from the picture box to the form with the
picture visibility set to false. I used to be able to do
it in VB6.

I am (obviously) ignorant, but not stupid.
Any help would be GREATLY appreciated (i.e. I'll email a
virtual 6-pack to anyone who provides help).



Tue, 03 May 2005 09:54:56 GMT  
 bitblt in .NET: ignorant but not stupid
Quote:
> I know, I know; I should show my exact code BUT (I don't
> have it with me on this machine), so here is what I
> remember.

> I am trying to create a Bitmap object from a .bmp file and
> bitblt it to a form or picturebox in VB.NET.

<snip>

You'll need to re-post this to a VB.NET newsgroup such as
microsoft.public.dotnet.languages.vb.* since this is a VB (Classic) group.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/




Tue, 03 May 2005 12:20:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Bitblt in VB.NET

2. I feel stupid -problems showing a second form (Vb.Net)

3. bitblt in vb.net

4. Stupid question from a perhaps stupid beginner.

5. KB Q147810 BitBlt not working correctly

6. STupid guy and Stupid problem

7. Stupid guy and stupid problem

8. Stupid guy and stupid problem

9. Stupid guy and Stupid problem

10. STupid guy and stupid problem

11. BitBlt does not work on some Printers

12. Picturebox not painted White (BitBlt?)

 

 
Powered by phpBB® Forum Software