Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The ultimate image control

Status
Not open for further replies.

MrMoocow

Programmer
Joined
May 19, 2001
Messages
380
Location
US
What is the best image control for games , Picture boxs have lines that run down them when being moved.
 
If you want decent graphics, you'll definately want to go with the picture box. The trick is, instead of moving the picture box, you move the bitmap image inside the picture box. Check out some of the online tutorials regarding the BitBlt API function. It's a tricky function to learn to use, but it's invaluable compared to moving actual controls around to simulate animation. In order to use BitBlt, you need to have a control that has a hDC (Device Context Handle) property. This is a handle that Windows uses to reference a bitmap image stored in memory. The image control does not have this property, but the picture box does (In fact, Windows doesn't even know when an image control is loaded, Visual Basic simulates its existance).

Learn enough about BitBlt and you can even create sprites, bitmap images with transparent backgrounds. BitBlt is the very function that Windows itsself uses to draw almost all of its graphics (or so I read somewhere).

Happy gaming!

-Mike
 
Mike,
Can you give a link to an "online tutorial" on BitBlt and Device Context?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top