| |
|
|
 AndreasS | Bueno Morgen, el Cuestión: In una Programa möchte Yo gern PNG's como Schaltflächen uso. Dabei se beim darüberfahren con ratón una más Bild (ebenfalls con transparentem Hintergrund) adecuado y ser en Mausklick una weiteres. Über Mausbereiche kein Problema. Aber: el setzt el Einsatz el Abfrage (@mouse) voraus y dies verhindert el Einsatz de waitinput en en otro (z.B.) Button a reagieren. Weis irgend alguien una solución ? Der Einsatz uno Message en el Waitinput a durchbrechen, es weder sinnvoll, todavía nutzbringend.
Gracias
Andreas |
|
|
| |
|
|
|
 Jörg Sellmeyer | Hier hast Usted schonmal una Anfang: [...] 
Der Einsatz uno Message en el Waitinput a durchbrechen, es weder sinnvoll, todavía nutzbringend.
Öhm - wieso no?  |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 07.12.2011 ▲ |
|
|
|
|
 AndreasS | Zunächst Gracias. Aber el es wenig hilfreich. Bildbutton son kein Problema y BMP's a trabajo bringt nichts, wegen des fehlenden Alphakanals. Das Durchbrechen uno Waitinput en Auftreten uno Mausereignisses nutzt garnichts, como una Rücksprung sin Problemas no posible es. Jedenfalls no sin el el Programmablauf (hier) völlig durcheinander gerät.
Bye Andreas |
|
|
| |
|
|
|
 | Tal vez en esta Richtung. Neuzeichnen oder después de XProfan adaptar.
Declarar be#,erg&,erg2&,x&,y&
Dim be#,8
DEF GetCursorPos(1) !"USER32","GetCursorPos"
DEF WindowFromPoint(2) !"USER32","WindowFromPoint"
DEF ChildWindowFromPoint(3) !"USER32","ChildWindowFromPoint"
Def GetSysColor(1) !"USER32","GetSysColor"
Def ScreenToClient(2) !"USER32","ScreenToClient"
cls GetSysColor(15)
DEF &WM_MOUSEMOVE 512
Usermessages &WM_MOUSEMOVE
MCLS 40,40,RGB(0,255,0)
var bmp1%=Crear("HPIC",0,"& MEMBMP")
MCLS 40,40,RGB(255,0,0)
var bmp2%=Crear("HPIC",0,"& MEMBMP")
var Hdlg&=control("Dialog","",$58000000,50,50,40,40,%hwnd,5000,0)
Startpaint Hdlg&
DrawPic bmp1%, 0, 0; 0
Endpaint Hdlg&
mientras que 1
waitinput
caso %key=2:BREAK
If %Umessage = &WM_MOUSEMOVE
GetCursorPos(be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg&=@WindowFromPoint(x&,y&)
If erg&<>0
ScreenToClient(erg&,be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg2&=@ChildWindowFromPoint(erg&,x&,y&)
If erg2&=Hdlg&
Startpaint Hdlg&
DrawPic bmp2%, 0, 0; 0
Endpaint Hdlg&
mientras que 1
waitinput
If %Umessage = &WM_MOUSEMOVE
GetCursorPos(be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg&=@WindowFromPoint(x&,y&)
If erg&<>0
ScreenToClient(erg&,be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg2&=@ChildWindowFromPoint(erg&,x&,y&)
caso erg2&<>Hdlg& : BREAK
EndIf
EndIf
If %MousePressed
Messagebox("Das war una Mausklick en el Bild!","I N F O",4160)
SetFocus(Hdlg&)
EndIf
Wend
Startpaint Hdlg&
DrawPic bmp1%, 0, 0; 0
Endpaint Hdlg&
endif
EndIf
endif
wend
DeleteObject bmp1%
DeleteObject bmp2%
Disponer be#
end
Saludo Thomas |
|
|
| |
|
|
|
 Thomas Freier | Alphatrans va vermutlich sólo GDI+, oder lo hilft [...] más. Ejemplo con GDI
$H windows.ph
$H Functions_GDIPLUS.ph
$H GDIP_Imageging.ph
$I GDIP_Helper.inc
Declarar gdiplusToken&,ImageObject&,ImageObject1&,GraphicObject&,Attributes&
Declarar Color_Matrix#
SetAutoPaint 1
gdiplusToken& = InitGDIPlus()'GDIPlus starten
Declarar be#,erg&,erg2&,x&,y&
Dim be#,8
DEF GetCursorPos(1) !"USER32","GetCursorPos"
DEF WindowFromPoint(2) !"USER32","WindowFromPoint"
DEF ChildWindowFromPoint(3) !"USER32","ChildWindowFromPoint"
DEF GetSysColor(1) !"USER32","GetSysColor"
DEF ScreenToClient(2) !"USER32","ScreenToClient"
DEF &WM_MOUSEMOVE 512
cls GetSysColor(15)
Usermessages &WM_MOUSEMOVE
MCLS 100,100,GetSysColor(15)
var bmp1%=Crear("HPIC",0,"& MEMBMP")
var Hdlg&=control("Dialog","",$58000000,50,50,100,100,%hwnd,5000,0)
OBJECT "A-1.png"'Pfad adaptar
mientras que 1
waitinput
caso %key=2:BREAK
If %Umessage = &WM_MOUSEMOVE
GetCursorPos(be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg&=@WindowFromPoint(x&,y&)
If erg&<>0
ScreenToClient(erg&,be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg2&=@ChildWindowFromPoint(erg&,x&,y&)
If erg2&=Hdlg&
Crear("Mapa de bits", Hdlg&, bmp1%, 0, 0)
OBJECT "A-2.png"'Pfad adaptar
mientras que 1
waitinput
If %Umessage = &WM_MOUSEMOVE
GetCursorPos(be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg&=@WindowFromPoint(x&,y&)
If erg&<>0
ScreenToClient(erg&,be#)
x&=Largo(be#,0)
y&=Largo(be#,4)
erg2&=@ChildWindowFromPoint(erg&,x&,y&)
caso erg2&<>Hdlg& : BREAK
EndIf
EndIf
If %MousePressed
Messagebox("Das war una Mausklick en el Bild!","I N F O",4160)
SetFocus(Hdlg&)
EndIf
Wend
Crear("Mapa de bits", Hdlg&, bmp1%, 0, 0)
OBJECT "A-1.png"'Pfad adaptar
endif
EndIf
endif
caso %wmpaint:OBJECT "A-1.png"'Pfad adaptar
wend
DeleteObject bmp1%
DeleteObject bmp2%
Disponer be#
ExitGDIPlus(gdiplusToken&)'GDIPlus final
end
PROC OBJECT
parámetros file$
ImageObject1& = gdipLoadImage(file$)'Pfad adaptar
If ImageObject1&
'y en %hWnd dibujar
~GdipCreateFromHWND(Hdlg&,ADDR(GraphicObject&))'todos Gráficos-Operationen en %hWnd
~GdipDrawImageI(GraphicObject&,ImageObject&,20,0)'Mapa de bits dibujar
'Bild2 con dibujar
~GdipDrawImageRectRect(GraphicObject&,ImageObject1&,0.0,0.0,Single(400.0),Single(400.0),0.0,0.0,Single(400.0),Single(400.0),~UnitPixel,Attributes&,0,0)
~GdipDisposeImageAttributes(Attributes&)
~GdipDisposeImage(ImageObject&)
~GdipDisposeImage(ImageObject1&)
~GdipDeleteGraphics(GraphicObject&)
Disponer Color_Matrix#
Endif
ENDPROC
Saludo Thomas |
 |
|
| |
|
|