ochensati
05-23-2002, 11:57 AM
Ok I got bliting from the primary surface to a picturebox down and that works great. But when I try to go the other direction to put in a background, I completely fail. All I get is a black screen
Dim jj As Long, sky as stdpicture
Set sky = LoadPicture(App.Path + "\sky.bmp")
frmD(CURfloor).Canvas.AutoRedraw = True
jj = BitBlt(frmD(CURfloor).Canvas.hdc, 0, 0, _
frmD(CURfloor).Canvas.ScaleWidth, frmDCURfloor).Canvas.ScaleHeight ,
sky.Handle, 0, 0, SRCCOPY)
frmD(CURfloor).Canvas.Picture = frmD(CURfloor).Canvas.Image
I am just trying to get the stdpicture to a picture box and all I get is a black screen. The return value is always zero, but the results are definitly bad!
For the directx try I have
Dim jj As Long,sky as stdpicture
dim hdc as long
Device.BeginScene
hdc = Back.GetDC
jj = BitBlt(hdc, 0, 0, Width, Height , sky.Handle, 0, 0, SRCCOPY)
Back.ReleaseDC hdc
'render 3d stuff
Device.EndScene
Dim r1 As RECT 'The screen size
'Gets the bounding rect for the entire window handle, stores in r1
Call dx.GetWindowRect(BackO.hwnd, r1)
Call Primary.Blt(r1, Back, ScreenRect, DDBLT_WAIT)
This method works great if I use a DIB, but I would like the speed of a normal bitmap and the ease of manipulation.
Dim jj As Long, sky as stdpicture
Set sky = LoadPicture(App.Path + "\sky.bmp")
frmD(CURfloor).Canvas.AutoRedraw = True
jj = BitBlt(frmD(CURfloor).Canvas.hdc, 0, 0, _
frmD(CURfloor).Canvas.ScaleWidth, frmDCURfloor).Canvas.ScaleHeight ,
sky.Handle, 0, 0, SRCCOPY)
frmD(CURfloor).Canvas.Picture = frmD(CURfloor).Canvas.Image
I am just trying to get the stdpicture to a picture box and all I get is a black screen. The return value is always zero, but the results are definitly bad!
For the directx try I have
Dim jj As Long,sky as stdpicture
dim hdc as long
Device.BeginScene
hdc = Back.GetDC
jj = BitBlt(hdc, 0, 0, Width, Height , sky.Handle, 0, 0, SRCCOPY)
Back.ReleaseDC hdc
'render 3d stuff
Device.EndScene
Dim r1 As RECT 'The screen size
'Gets the bounding rect for the entire window handle, stores in r1
Call dx.GetWindowRect(BackO.hwnd, r1)
Call Primary.Blt(r1, Back, ScreenRect, DDBLT_WAIT)
This method works great if I use a DIB, but I would like the speed of a normal bitmap and the ease of manipulation.