Thats a Tut I made a while ago that I made blt from DX surface into a picture box, mayb/maynot help but thats basicly what you'll probably have to do. You'll have to adapt this so that it'll use Backbuffer as source instead of the items surface but err, maybe someone else can explain better
First, we’ll start by adding a timer, that every time is set off, will draw the item back into the picture boxes, so create a timer called ‘tmrBlt’ with an interval of 50.
Then add this code
Code:
Dim n As Integer
Dim DC As Long
' Get the DD Item surface DC
DC = DD_ItemSurf.GetDC
For n = 1 To 3
If lstItem(n).ListIndex > 0 Then
Call BitBlt(picItem(n).hdc, 0, 0, PIC_X, PIC_Y, DC, 0, Item(lstItem(n).ListIndex).Pic * PIC_Y, SRCCOPY)
Else
picItem(n).Refresh
End If
Next n
' Not 100% sure, but it unlocks the surface after you've gotten its dc
Call DD_ItemSurf.ReleaseDC(DC)
Not much difficult to understand with this code
DC = DD_ItemSurf.GetDC
This is like an address to the surface which we need to be able to blt something directly from the direct draw surface, only problem is that by doing this, we lock up the surface (I’ll tell you how to unlock it later)
For n = 1 To 3
If lstItem(n).ListIndex > 0 Then
Call BitBlt(picItem(n).hdc, 0, 0, PIC_X, PIC_Y, DC, 0, Item(lstItem(n).ListIndex).Pic * PIC_Y, SRCCOPY)
Else
picItem(n).Refresh
End If
Next n
That is the main section, all it does it runs through each picture box, checks if there’s an item selected in the list box, if there isn’t, it clears the picture box to make it blank by using the refresh function.
If there is an item to be bltted then it will call bitblt.
The first argument, picitem(n).hdc is basically the address for the picture box that were drawing to
The next two arguments are the x,y coordinates and since we want to blt it at the very top corner of the picture box, we have it as 0,0
The next two following them are the width, and height, and for both I have used a constant which at default are both 32 (Same size as the picture box)
Onto the next argument, this is where we supply the address to the source, which in this case is the direct draw surface, which if you remember, we saved to the variable DC
Next two arguments are the source x,y. Since we start on the very left of the item sheet, x = 0, but since y changes depending on the item, we find out what picture number the item is assigned, then we multiply by 32(pic_y) pixels to get the actual location on the items sheet
The final Argument tells it what type of blt to perform, there are many different types, depending on what effects you want but this one (SRCCOPY) just copies the image directly over as it is
The final piece of text (Call DD_ItemSurf.ReleaseDC(DC)) is the part that unlocks the surface we used as a source