Posts: 6,419
Threads: 74
Joined: Mar 2002
I am using a picture box to simulate some kind of virtual screen where I can print things and draw stuff.
I have two questions:
1. How can I load a picture (BMP or whatever) from disk and draw it anywhere on the picture box? Can't it be done without GDI stuff?
2. Is there any way to have the whole thing scroll up a line just like in DOS where you print until you run out of screen?
Thanks
Posts: 2,020
Threads: 24
Joined: Jun 2002
picture box graphics are virtual crap. the only real way to get decent graphical control in vb is to use the directx sdk.
i've never known a way to change the area of a picturebox. however, this guy seems to have found a way by directly using the gdi:
http://www.rookscape.com/vbgaming/tutW.php
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Posts: 6,419
Threads: 74
Joined: Mar 2002
Thanks, I'll check it out.
Yeh, I know DX is better, but I am coding for a Win3.1 computer GEEz
Posts: 614
Threads: 87
Joined: Aug 2001
Quote:Yeh, I know DX is better, but I am coding for a Win3.1 computer GEEz
Only one question comes to mind as I read this:
WHY?
Posts: 6,419
Threads: 74
Joined: Mar 2002
Quote:na_th_an Wrote:Yeh, I know DX is better, but I am coding for a Win3.1 computer GEEz
Only one question comes to mind as I read this: WHY?
Exactly for the same reason why 600 people in this forum are coding for DOS
LATER:
I've typed in this code. I have two picture boxes. I just want to bitblt one into another. I have used this code before, but this time all I get is a white square or garbage copied instead of the actual image. Can anybody help? What have I done wrong?
Code:
auxPicBox.Picture = LoadPicture(app.Path + "\Pic1.bmp")
auxPicBox.Refresh
iSrcDC = auxPicBox.hDC
iDstDC = MyScreen.hDC
'Copy part of source into destination a few times
result% = BitBlt(iDstDC, 0, 0, auxPicBox.Height, auxPicBox.Width, iSrcDC, 0, 0, SRCCOPY)
'Invoke refresh method so we can see changes
MyScreen.Refresh
Posts: 6,419
Threads: 74
Joined: Mar 2002
Hmmmm - A simple question... Am I the strangest man on earth? Why I have *never* got a proper answer to *any* question I've done in this forum? :rotfl:
Posts: 1,138
Threads: 211
Joined: Feb 2020
I doubt you don't get answer because you're strange ;-) More likely its that they actually good questions and there aren't many people experience with it to answer you..
Posts: 1,845
Threads: 44
Joined: Aug 2002
You pose elite questions
1337
lol
Posts: 6,419
Threads: 74
Joined: Mar 2002
hahahaha - Nope, the reason is that my questions are strange... I see nobody else coding a VB3 app for Windows 3.1 using GDI in the world
Posts: 788
Threads: 53
Joined: Nov 2002
I used to back in the win 3.1 days
oship me and i will give you lots of guurrls and beeea