Здравствуйте!
Сделал тень рисунка с помощью GetPixel, SetPixel, но никак не удается сделать с помощью BitBlt.
Поднаправьте чуть-чуть, если можно, как это можно сделать с помощью BitBlt, или дугой быстрой функцией.
Спасибо!
Private Sub DrawPicture(hdc As Long, rcAreaPicture As RECT, Picture As StdPicture, clPicShadow As Boolean)
Dim hDcSource As Long, hSourceOld As Long
Dim hDcColor As Long, hColorOld As Long, hColorBuff As Long
Dim hMaskDC As Long, hMaskOld As Long, hMaskBuff As Long
Dim PicSize As POINTAPI, Pt As POINTAPI, rec As RECT
If Picture Is Nothing Then Exit Sub
hDcSource = CreateCompatibleDC(hdc)
hSourceOld = SelectObject(hDcSource, Picture.Handle)
hColorBuff = CreateCompatibleBitmap(hdc, PicSize.X, PicSize.Y)
hDcColor = CreateCompatibleDC(hdc)
hColorOld = SelectObject(hDcColor, hColorBuff)
hMaskBuff = CreateBitmap(PicSize.X, PicSize.Y, 1, 1, ByVal 0&)
hMaskDC = CreateCompatibleDC(hdc)
hMaskOld = SelectObject(hMaskDC, hMaskBuff)
'.... BitBlt операции
Call SelectObject(hDcSource, hSourceOld)
DeleteObject SelectObject(hDcColor, hColorOld)
DeleteObject SelectObject(hMaskDC, hMaskOld)
Call DeleteDC(hDcSource)
Call DeleteDC(hColorOld)
Call DeleteDC(hMaskDC)
DeleteObject hColorBuff
DeleteObject hMaskBuff
End Sub
Call SelectObject(hDcSource, hSourceOld)
Call SelectObject(hDcColor, hColorOld)
Call SelectObject(hMaskDC, hMaskOld)
Call DeleteDC(hDcSource)
Call DeleteDC(hColorOld)
Call DeleteDC(hMaskDC)
DeleteObject hColorBuff
DeleteObject hMaskBuff
Call SelectObject(hDcSource, hSourceOld)
DeleteObject SelectObject(hDcColor, hColorOld)
DeleteObject SelectObject(hMaskDC, hMaskOld)
Call DeleteDC(hDcSource)
Call DeleteDC(hColorOld)
Call DeleteDC(hMaskDC)
DeleteObject hColorBuff
DeleteObject hMaskBuff
Все меню Windows показываются, как будто кто-то питается их перекрасить.GSerg писал(а):Что значит "сбой"?
a = SelectObject(hDcSource, hSourceOld)
b = SelectObject(hDcColor, hColorOld)
c = SelectObject(hMaskDC, hMaskOld)
d = DeleteDC(hDcSource)
e = DeleteDC(hColorOld)
f = DeleteDC(hMaskDC)
g = DeleteObject(hColorBuff)
k = DeleteObject(hMaskBuff)
Сейчас этот форум просматривают: Google-бот и гости: 100