Прозрачные кнопки
Фото результата :
Код реализации :
OpenWindow(0,500,150,400,400,"Прозрачные кнопки")
; CreateGadgetList(WindowID(0))
ButtonGadget(5, 205, 85, 105, 30, "Кнопка 5")
ButtonGadget(6, 85, 85, 105, 30, "Кнопка 6")
ButtonGadget(7, 140, 185, 105, 30, "Кнопка 7")
HyperLinkGadget(33, 240, 375, 200, 15, "http://purebasic.info/phpBB2", $000000)
SetGadgetColor(33, #PB_Gadget_FrontColor, $174086)
hWnd=WindowID(0)
hdc = GetDC_(hWnd)
memhdc = CreateCompatibleDC_(hdc)
SelectObject_(memhdc,CreateCompatibleBitmap_(hdc,400,400))
SelectObject_(memhdc,CreatePen_(#PS_DASH,400,RGB(234, 126, 126)))
Rectangle_(memhdc,0,0,400,400)
SelectObject_(memhdc,CreatePen_(#PS_DASH,110,RGB(167, 255, 131)))
Rectangle_(memhdc,105,105,200,100)
SelectObject_(memhdc,CreatePen_(#PS_DASH,110,RGB(101, 127, 197)))
Rectangle_(memhdc,105,225,130,240)
SelectObject_(memhdc,CreatePen_(#PS_DASH,110,RGB(249, 228, 103)))
Rectangle_(memhdc,300,225,270,240)
; SetPixel_(memhdc,45,45,$000000)
Repeat
BitBlt_(hdc,0,0,400,400,memhdc,0,0,#SRCAND)
Event=WaitWindowEvent()
Gadget=EventGadget()
If Event=#PB_Event_Gadget And Gadget=33
Silka.s=GetGadgetText(33)
RunProgram(Silka)
EndIf
If Event=#PB_Event_CloseWindow
Break
EndIf
ForEver
; CreateGadgetList(WindowID(0))
ButtonGadget(5, 205, 85, 105, 30, "Кнопка 5")
ButtonGadget(6, 85, 85, 105, 30, "Кнопка 6")
ButtonGadget(7, 140, 185, 105, 30, "Кнопка 7")
HyperLinkGadget(33, 240, 375, 200, 15, "http://purebasic.info/phpBB2", $000000)
SetGadgetColor(33, #PB_Gadget_FrontColor, $174086)
hWnd=WindowID(0)
hdc = GetDC_(hWnd)
memhdc = CreateCompatibleDC_(hdc)
SelectObject_(memhdc,CreateCompatibleBitmap_(hdc,400,400))
SelectObject_(memhdc,CreatePen_(#PS_DASH,400,RGB(234, 126, 126)))
Rectangle_(memhdc,0,0,400,400)
SelectObject_(memhdc,CreatePen_(#PS_DASH,110,RGB(167, 255, 131)))
Rectangle_(memhdc,105,105,200,100)
SelectObject_(memhdc,CreatePen_(#PS_DASH,110,RGB(101, 127, 197)))
Rectangle_(memhdc,105,225,130,240)
SelectObject_(memhdc,CreatePen_(#PS_DASH,110,RGB(249, 228, 103)))
Rectangle_(memhdc,300,225,270,240)
; SetPixel_(memhdc,45,45,$000000)
Repeat
BitBlt_(hdc,0,0,400,400,memhdc,0,0,#SRCAND)
Event=WaitWindowEvent()
Gadget=EventGadget()
If Event=#PB_Event_Gadget And Gadget=33
Silka.s=GetGadgetText(33)
RunProgram(Silka)
EndIf
If Event=#PB_Event_CloseWindow
Break
EndIf
ForEver