🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

win32 api

Started by
3 comments, last by guru 24 years, 7 months ago
Have you loaded the image into the picturebox??

------------------
Dance with me......

Advertisement
currently the map editor is only in the early stages of implementation. Basically what I want to do is bitblt a picture from the picture box to the top left corner on the form when the user clicks there.
In the form load proc I load the bmp of the tile into the picture box which is on a frame on the form. Whenever the user clicks on the form at the top left corner it should bitblt the picture from the pic box to (0,0) on the form but as I said before the picture shows up as a black square. The Procedure I am using with bitblt is SRCCopy. Should I be using that procedure?

I don't work with Visual Basic anymore so I don't really know. But I would check all my return values and write them to a file, so you can see what might go wrong.

Also, I'm not quite sure, but you load a bitmap into the picturebox (on the run I supose). I don't knw how the structure in a VB project is build up. But with VC++ you need to have the bitmap in the same directory as your executable file is. When VC++ compiles and runs the program it looks for the file in the directory right under the directory where the exectuable is located. Maybe it's such a problem.

I would definitely chck whether the file IS loaded (through a return value).

Maybe smeone with knowledge about VB should answer this question....

------------------
Dance with me......

I am programming a map editor in vb and when I use the bitblt() function of the win api to blit the tiles from a pic box to the form it only blits a black square the size of the tile. I have all the required params right, so why is this happening?
RSVP
Any help is greatly appreciated.
Guru

I know it can be done as I have done it in the past. I cant remember which flags you should use on the blit though. My advice would be to us the API viewer to get the declares for all the different blit modes and try them out. Also it might be worth trying to blit to another picturebox instead of the form.

Just had a look at the last thing I wrote that did this and this is what I used

BitBlt picBackground.hdc, 0, 0, objfBitmap.Width, objfBitmap.Height, objfBitmap.hdc, 0, 0, SRCCOPY

(objfBitmap is an instance of vb class that some one here wrote that basicly just creates a GDI bitmap.)

so SRCcopy is probably ok.

Also I make quite heavy use of hte win32sdk.hlp help file.

This topic is closed to new replies.

Advertisement