Is it possible to use an IpictureDisp variable with BitBlt?
This is in module:
This is in form:Code:'Enable BitBlt Public Declare Function BitBlt Lib "gdi32.dll" _ (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
End SubCode:Dim pic As IPictureDisp Private Sub Command1_Click() Form1.AutoRedraw = True Picture1.AutoRedraw = True Set pic = LoadPicture("D:\Alejandro\VB Programs\RPG\Sprites and Bitmaps\Enemies\dim master.gif") picture1.cls BitBlt Picture1.hDC, 0, 0, pic.Width, pic.Height, pic.Handle, 0, 0, vbSrcCopy
I'm not too sure if pic.Handle is supposed to be used here...
But essentially, I just want to use bitblt (or any similar function for that matter) without having to keep track of the pixel dimensions of the source image. Cause im trying to create animations (multiple pictures) and for each picture I have to keep track of the exact dimension of each picture so it blts properly, for example this is what i want to avoid:
Code:Const DimMasterWidth = 119 Const DimMasterHeight = 153 picture1.cls BitBlt Picture1.hDC, 0, 0, DimMasterWidth, DimMasterHeight, picSource.hDC, 0, 0, vbSrcCopy
I wanna be able to load the pictures into the program at the beginning of runtime and i want vb to automatically keep track of the dimensions through Pic.Width and Pic.Height or something along those lines. Essentially, i dont wanna have to type in:because i have ALOT of pictures (hundreds), and its alot of tedious work (and i think unnecessary).Code:Const DimMasterWidth = 119 Const DimMasterHeight = 153
Any suggestions? I'm open to new functions as well, anything at all. I've tried Pic.Render instead of BitBlt except i cant seem to keep the scale size the same (reply if you wanna see my code for that method).
Help plz




Reply With Quote