|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Blitting (VB enquiry)
Here is the code that does the blitting (+ some other shit) Don't expect it to look great pls... I'm not that good a coder. Gerco. ----- Original Message ----- From: "Tom Webb" <tom@thewebb.screaming.net> To: <gameprogrammer@gameprogrammer.com> Sent: Saturday, September 16, 2000 17:21 PM Subject: RE: Blitting (VB enquiry) > Hi all, > > What did you bitblt in your screensaver? I am trying to copy a graphic onto > a picture box. I have source code of two other programs which also do this > but no matter how hard I try to adapt the code, it doesn't work... Very > infuriating! > > Thanks, > > Tom > > -----Original Message----- > From: gameprogrammer-owner@gameprogrammer.com > [mailto:gameprogrammer-owner@gameprogrammer.com]On Behalf Of Gerco Dries > Sent: 16 September 2000 14:02 > To: gameprogrammer@gameprogrammer.com > Subject: Re: Blitting (VB enquiry) > > > I used BitBlt in my vb program as well, worked like a charm, but I didn't > blit onto a vb form (or a vb anything for that matter), it was for a > screensaver preview in the control panel applet. > > I guess the advice would be: Don't blit onto a vb form (or a vb anything for > that matter). Use the vb functions instead, or don't use vb at all. > > Gerco Dries. > ----- Original Message ----- > From: "Tom Webb" <tom@thewebb.screaming.net> > To: <gameprogrammer@gameprogrammer.com> > Sent: Saturday, September 16, 2000 11:28 AM > Subject: Blitting (VB enquiry) > > > > Hi all, > > > > I am having a total nightmare trying to incorporate blitting into my > > program. I have a large picture box to represent the planets surface and a > > small picture box to hold the graphic I want to blit onto the planets > > surface. I run my blitting routine and nothing happens, no errors and no > > blitting! :-0! I have been working on it for nearly a week now and am sure > > there is a simple explaination for it. But for the life of me I cannot > find > > it! > > > > I beg you to put me out of my misery and give me a hand :-) > > > > The form is called main, the picture boxes are called picPlanet (the > > planets surface) and picBuilding (the image I want to blit onto the > planets > > surface). > > > > Here is the code. > > > > Private Sub sprite_paint(x As Integer) > > 'Subroutine to paint a building > > 'x = the counter > > > > 'declarations > > Dim retcode As Integer 'dummy return code > > Dim xpix 'temporary x coord in pixel > > Dim ypix 'temporary y coord in pixel > > > > 'inits > > xpix = dx > > ypix = dy > > > > 'now blit the sprite > > retcode = BitBlt(Main.picPlanet.hdc, (Building(x).x), (Building(x).y), dx, > > dy, Main.picBuilding.hdc, xpix, ypix, SRCCOPY) > > End Sub > > > > 'The type declarations > > > > Type BuildingType > > Name As String * 20 'The buildings name > > owner As Integer 'The buildings owner > > x As Integer 'X location of the building > > y As Integer 'Y location of the building > > Type As Integer 'The buildings type > > Maximum_Capacity As Integer 'The maximum storage capacity of the > > building > > Amount As Integer 'The Amount stored in the building > > Production As Integer 'The production of the building > > Maximum_Health As Integer 'The maximum health of the building > > Health As Integer 'The current health of the building > > Size As Integer 'How big is the building > > Maximum_Soldiers As Integer 'The maximum number of soldiers > > Soldiers As Integer 'The current amount of soldiers > > Soldier_Type As Integer 'The type of of soldiers > > End Type > > > > ================================================================= > > The GameProgrammer.Com mailing list is for the open discussion > > of any topic related to the art, science, and business of > > programming games. This list is especially tolerant of beginners. > > We were all beginners once > > > > To SUBSCRIBE or UNSUBSCRIBE please visit: > > http://gameprogrammer.com/mailinglist.html > > > > ================================================================= > The GameProgrammer.Com mailing list is for the open discussion > of any topic related to the art, science, and business of > programming games. This list is especially tolerant of beginners. > We were all beginners once > > To SUBSCRIBE or UNSUBSCRIBE please visit: > http://gameprogrammer.com/mailinglist.html > > ================================================================= > The GameProgrammer.Com mailing list is for the open discussion > of any topic related to the art, science, and business of > programming games. This list is especially tolerant of beginners. > We were all beginners once > > To SUBSCRIBE or UNSUBSCRIBE please visit: > http://gameprogrammer.com/mailinglist.html >
|
|