PictureBox 3개 추가한다. Picture1 에 Picture 속성 준다.(그림 선택한다)
실행하면 투명도가 조절된 모양으로 나타난다.
참고로 원문 소스의 Picture2 부분을 조금 수정했다. 원문 소스로 하면 Picture2 부분이 아무 변화 없는데 아마도 코딩 실수인듯하다...
Private 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 Integer
Private Sub Form_Load()
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
Picture3.AutoRedraw = True
Picture1.ScaleMode = vbPixels
'투명도 설정
BitBlt Picture2.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.hdc, 0, 0, vbSrcAnd
BitBlt Picture3.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.hdc, 0, 0, vbSrcPaint
End Sub
Source Page : http://www.mentalis.org/tips/tip008.shtml