Jump to content

  • Log In with Google      Sign In   
  • Create Account


win32 api


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 guru   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 November 1999 - 10:22 PM

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

Sponsor:

#2 CJ   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 November 1999 - 06:17 AM

Have you loaded the image into the picturebox??

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


#3 guru   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 November 1999 - 03:48 AM

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?

#4 CJ   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 November 1999 - 10:01 PM

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......


#5 STG   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 November 1999 - 10:22 PM

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.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS