01-06-2006, 09:52 PM
Author: William
Difficulty: 3/5
To blt things onto the picScreen you can use:Which is easier to use in my opinion, but then you need to load a tileset to into a picture control. Here you have a example:That's basically a copy paste from my single player engine, just changed some names on it. But the easiest thing to understand BitBlt is to study the Function.
You can also use:To blt transparent tiles, ex:
Another way is to use the image control, put it on the screen make it visible = false. Then on the top in the coding part add:And in form_load put this:And then to use it, use this code to load it:And to move it around use this:or:
Difficulty: 3/5
To blt things onto the picScreen you can use:
Code:
Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Code:
BitBlt frmMirage.picScreen.hdc, picx, picy, 32, 32, frmMirage.PictureControl.hdc, tempx, tempy, vbSrcCopy
You can also use:
Code:
Public Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Boolean
Code:
Call TransparentBlt(frmMirage.picScreen.hdc, picx, picy, 32, 32, frmMirage.PictureControl.hdc, tempx, tempy, 32, 32, RGB(0, 0, 0))
Another way is to use the image control, put it on the screen make it visible = false. Then on the top in the coding part add:
Code:
Dim NewElement As Integer
Code:
NewElement = 1
Code:
Load Image1(NewElement)
Image1(NewElement).Visible = True
Code:
Image1(NewElement).Top = Image1(NewElement).Top + 50
Code:
Image1(NewElement).Left = Image1(NewElement).Left + 50