VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: An error... Jay Wheeler (3 replies, 0 views) (2000-Jul-6) An alternative to his method -- just use a pictureBox (call it 'pictureLoader' or something) and load into it. Keep it invisible, and make sure AutoRedraw is TRUE. Then, lock the surface and get the DC, and use bitBLT to copy the image to your surface, and then release the DC. It should take only five minutes to write a nice generic SUB to do it (pass it a filename and a surface), and then you're set.
The advantage to using the pictureBox is that you can use all the file formats supported by VB, and also, if you turn AutoSize to TRUE, you don't have to pass the dimensions you want since your pictureBox will assume the correct size.
|