| |||
Views: 88,502,885 |
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search | 04-30-24 01:31 AM |
|
Guest: Register | Login |
0 users currently in Computing | 1 guest |
Main - Computing - I need help with picture boxes in VB6 | New thread | New reply |
darkwitch |
| ||
Paragoomba Level: 20 Posts: 60/65 EXP: 41520 Next: 919 Since: 02-21-07 From: Puerto Rico Last post: 6224 days Last view: 6224 days |
So I'm on a project (ROM-Hacking related which I wont talk about untill is near done) but I can't figure how to make a picture box display more than one image. I tried:
lvl.Picture = lvl.Picture + LoadPicture(stuff here) But that gives me an error at the + sign. The VB Book I have here doesn't says how to add more than one Image to the box. Can anyone tell me how to do that, please. |
HyperHacker |
| ||
... Level: 73 Posts: 285/1220 EXP: 3367758 Next: 118110 Since: 03-25-07 From: no Last post: 6095 days Last view: 6078 days |
You'll need to use the API. Check out BitBlt, CreateCompatibleDC, etc. It's a bit difficult at first but once you get used to it it's pretty simple.
There may be some VB hackery to do it but pfft, that's just going to be slow and hog resources. |
GuyPerfect |
| ||
Paratroopa Level: 30 Posts: 15/155 EXP: 152644 Next: 13225 Since: 03-14-07 Last post: 6049 days Last view: 5998 days |
PictureBox controls have a PaintPicture method that can be used with LoadPicture(). You can avoid the use of GDI that way. |
darkwitch |
| ||
Paragoomba Level: 20 Posts: 61/65 EXP: 41520 Next: 919 Since: 02-21-07 From: Puerto Rico Last post: 6224 days Last view: 6224 days |
Well I read a little document about PaintPicture but the syntax it shows wont work. I tried this:
lvl.PaintPicture(CurDir() + "\sprites\" + sphexnum + ".bmp", xpos, ypos, width, height) Is that how its suppose to go? Because thats the syntax that was on the document I read, but it gives me an error. |
GuyPerfect |
| ||
Paratroopa Level: 30 Posts: 16/155 EXP: 152644 Next: 13225 Since: 03-14-07 Last post: 6049 days Last view: 5998 days |
PaintPicture takes a "Picture" as an argument, not a filename. LoadPicture(), however, takes a filename and returns a "Picture" from it. So your code is close, but just needs some revision:
lvl.PaintPicture(LoadPicture(App.Path & "\sprites\" & sphexnum & ".bmp"), xpos, ypos, width, height) |
Sukasa |
| ||
Red Birdo Level: 92 Posts: 145/2112 EXP: 7691576 Next: 65361 Since: 02-19-07 Last post: 4451 days Last view: 3223 days |
EDIT: Beaten to it and ddn't really get it right anyways |
Main - Computing - I need help with picture boxes in VB6 | New thread | New reply |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 57, rows: 71/72, time: 0.015 seconds. |