OK here's the score, I've created two device contexts and loaded a bitmap using the LoadImage API. I'm now 'selecting' the bitmap into the first DC and the BitBlt'ing it into the second DC but when I try to BitBlt this DC to the form for testing I get nothing.
This is the troublesome code:
VB Code:
'Create a copy of the original bitmap so it can be masked
I'll also attach the form incase anyone needs a closer inspection. When the command button is clicked 2 images of an apple should appear in the top-left corner.
OK here's the score, I've created two device contexts and loaded a bitmap using the LoadImage API. I'm now 'selecting' the bitmap into the first DC and the BitBlt'ing it into the second DC but when I try to BitBlt this DC to the form for testing I get nothing.
This is the troublesome code:
VB Code:
'Create a copy of the original bitmap so it can be masked
I'll also attach the form incase anyone needs a closer inspection. When the command button is clicked 2 images of an apple should appear in the top-left corner.
I can't find nothing in your code where you are bitblting one DC into another. This is proper badly doing my head in now because I don't understand why it wont work.
I've tried doing it into a picture box then bitblting this picture box into another and that works fine, so why won't it work fine if I create the DC's myself?
I can't find nothing in your code where you are bitblting one DC into another. This is proper badly doing my head in now because I don't understand why it wont work.
I've tried doing it into a picture box then bitblting this picture box into another and that works fine, so why won't it work fine if I create the DC's myself?
Ok, i've been lookign at this for a while and foolishly i didnt read the last line of your comments, i cant seme to finda way at the moment i'll kepe trying though.
Pino that's practically exactly the same thing I'm trying to do apart from my bitmap handle resides in a global variable and it's never deleted, so why isn't it working?
I need the bitmap handle in a global variable btw because I first started this on a game so I don't want to be loading the image for each frame.
Also I nearly got majorly confused by your code but realised it isnt actually copying anything, if you see the code below I have commented out one line and it still functions OK. It works to a certain extent but I need to copy it to another memory DC after the select statement and then use this new copied DC to draw my objects on screen.
Well ! You don't saw anithing in my code in order to met your needs ! Only because I do a BitBlt inside a memory DC and then, BitBlt it back to a OCX.hDC ! They are always DC's ! Anyway this doesn't work for you ! Let's try another thing ! Have you tried to use CopyMemory ? This functions maybe can do what BitBlt - in this case - can't ! I don't know if it will work, but, maybe !