04. august 2001 - 19:00Der er
8 kommentarer og 1 løsning
Gennemsigtig picture1
Er der nogle af jer VB gutter som kan fortælle mig hvordan man gør sin picturebox gennemsigtig. Det vil sige at man har insat et billede af et hus, men det er kun huset som skal kunne ses, men resten af picturebox skal ikke.?
Hvad med blot at ændre baggrundsfarve på billedet med huset, så det har samme farve som baggrunden på din form ? Jeg mener ikke du kan lave dele af en picturebox transparent.
Hmm...Ja jeg kunne prøve med PSP men jeg bruger mest Fireworks... Lave billedet den samme farve, nej det går pga at der er flere farver på billedet end 1.
\'------------------------------------ Module1 ------------------------------------ Declare Function TransparentBlt Lib \"msimg32\" _ (ByVal hdcDest As Long, ByVal nXOriginDest As Long, _ ByVal nYOriginDest As Long, ByVal nWidthDest As Long, _ ByVal nHeightDest As Long, ByVal hdcSrc As Long, _ ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, _ ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, _ ByVal crTransparent As Long) As Long
Declare Function GetPixel Lib \"gdi32\" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long Declare Function GetObject Lib \"gdi32\" Alias \"GetObjectA\" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long Declare Function SelectObject Lib \"gdi32\" (ByVal hdc As Long, ByVal hObject As Long) As Long Declare Function CreateCompatibleDC Lib \"gdi32\" (ByVal hdc As Long) As Long Declare Function DeleteDC Lib \"gdi32\" (ByVal hdc As Long) As Long Public Declare Function LoadImage Lib \"user32\" Alias \"LoadImageA\" (ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long Public Declare Function DeleteObject Lib \"gdi32\" (ByVal hObject As Long) As Long
Public Type Bitmap bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As Long End Type
Public Const LR_CREATEDIBSECTION = &H2000 Public Const LR_LOADFROMFILE = &H10 \'------------------------------------ Module1 ------------------------------------
\'------------------------------------- Form1 ------------------------------------- Dim hdcSrc As Long Dim hdcWidth As Integer Dim hdcHeight As Integer Dim filename As String
Private Sub GetDimensions() Dim dbitmap As Bitmap Dim hbitmap As Long
jeg har kigget på dit eks, og det er også godt nok, men det jeg mener er at når man starter sin form så er der en picture1 og den er der med det samme, og så skal man kunne rykke rundt med den.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.