English
Forum

Images as Rolloverbutton

 

AndreasS
good tommorrow,
The question: In one Program would like I gladly PNG's as Schaltflächen use. thereby should at darüberfahren with the mouse one other Image (ditto with transparentem background) showing and with Click one further. About Mausbereiche no trouble. but: the setting whom employment the request (@mouse) ahead and this prevented whom employment of waitinput circa on others (z.B.) Button To react. wisely anybody a Solution ?
The employment of/ one Message around the Waitinput To durchbrechen, is weder meaningfully, yet nutzbringend.

thanks

Andreas
 
12/07/11  
 




Jörg
Sellmeyer
here have You Schonmal a beginning:  [...] 


The employment of/ one Message around the Waitinput To durchbrechen, is weder meaningfully, yet nutzbringend.


Öhm - wieso not?
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
12/07/11  
 




AndreasS
first of all thanks. but this is unhelpful. Bildbutton are no trouble and BMP's To works bring nothing, because of the missing Alphakanals.
the Durchbrechen one Waitinput with appear one Mausereignisses uses garnichts, there one Rücksprung without Problems you don't say so is. anyway not without the the Programmablauf (here) at sixes and sevens unit.

Bye
Andreas
 
12/07/11  
 



Perhaps in these direction. Repaint or to XProfan adjust.
Declare 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
User Messages &WM_MOUSEMOVE
MCLS 40,40,RGB(0,255,0)
var bmp1%=Create("HPIC",0,"&MEMBMP")
MCLS 40,40,RGB(255,0,0)
var bmp2%=Create("HPIC",0,"&MEMBMP")
var Hdlg&=control("Dialog","",$58000000,50,50,40,40,%hwnd,5000,0)
Startpaint Hdlg&
DrawPic bmp1%, 0, 0; 0
Endpaint Hdlg&

while 1

    waitinput
    case %key=2:BREAK

    If %Umessage = &WM_MOUSEMOVE

        GetCursorPos(be#)
        x&=Long(be#,0)
        y&=Long(be#,4)
        erg&=@WindowFromPoint(x&,y&)

        If erg&<>0

            ScreenToClient(erg&,be#)
            x&=Long(be#,0)
            y&=Long(be#,4)
            erg2&=@ChildWindowFromPoint(erg&,x&,y&)

            If erg2&=Hdlg&

                Startpaint Hdlg&
                DrawPic bmp2%, 0, 0; 0
                Endpaint Hdlg&

                while 1

                    waitinput

                    If %Umessage = &WM_MOUSEMOVE

                        GetCursorPos(be#)
                        x&=Long(be#,0)
                        y&=Long(be#,4)
                        erg&=@WindowFromPoint(x&,y&)

                        If erg&<>0

                            ScreenToClient(erg&,be#)
                            x&=Long(be#,0)
                            y&=Long(be#,4)
                            erg2&=@ChildWindowFromPoint(erg&,x&,y&)
                            case erg2&<>Hdlg& : BREAK

                        EndIf

                    EndIf

                    If  %MousePressed

                        Messagebox("Das was one Click in the Image!","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%
Dispose be#
end

Greeting Thomas
 
12/07/11  
 




Thomas
Freier
Alphatrans goes presumably only with GDI+, or it helps [...]  moreover.
example with GDI
 $H windows.ph
 $H Functions_GDIPLUS.ph
 $H GDIP_Imageging.ph
 $I GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,ImageObject1&,GraphicObject&,Attributes&
Declare Color_Matrix#
SetAutoPaint 1
gdiplusToken& = InitGDIPlus()'GDIPlus started
Declare 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)
User Messages &WM_MOUSEMOVE
MCLS 100,100,GetSysColor(15)
var bmp1%=Create("HPIC",0,"&MEMBMP")
var Hdlg&=control("Dialog","",$58000000,50,50,100,100,%hwnd,5000,0)
OBJECT "A-1.png"'way adjust

while 1

    waitinput
    case %key=2:BREAK

    If %Umessage = &WM_MOUSEMOVE

        GetCursorPos(be#)
        x&=Long(be#,0)
        y&=Long(be#,4)
        erg&=@WindowFromPoint(x&,y&)

        If erg&<>0

            ScreenToClient(erg&,be#)
            x&=Long(be#,0)
            y&=Long(be#,4)
            erg2&=@ChildWindowFromPoint(erg&,x&,y&)

            If erg2&=Hdlg&

                Create("Bitmap", Hdlg&, bmp1%, 0, 0)
                OBJECT "A-2.png"'way adjust

                while 1

                    waitinput

                    If %Umessage = &WM_MOUSEMOVE

                        GetCursorPos(be#)
                        x&=Long(be#,0)
                        y&=Long(be#,4)
                        erg&=@WindowFromPoint(x&,y&)

                        If erg&<>0

                            ScreenToClient(erg&,be#)
                            x&=Long(be#,0)
                            y&=Long(be#,4)
                            erg2&=@ChildWindowFromPoint(erg&,x&,y&)
                            case erg2&<>Hdlg& : BREAK

                        EndIf

                    EndIf

                    If  %MousePressed

                        Messagebox("Das was one Click in the Image!","I n F O",4160)
                        SetFocus(Hdlg&)

                    EndIf

                Wend

                Create("Bitmap", Hdlg&, bmp1%, 0, 0)
                OBJECT "A-1.png"'way adjust

            endif

        EndIf

    endif

    case %wmpaint:OBJECT "A-1.png"'way adjust

wend

DeleteObject bmp1%
DeleteObject bmp2%
Dispose be#
ExitGDIPlus(gdiplusToken&)'GDIPlus terminate
end

PROC OBJECT

    parameters file$
    ImageObject1& = gdipLoadImage(file$)'way adjust

    If ImageObject1&

        'and on %hWnd draw
        ~GdipCreateFromHWND(Hdlg&,ADDR(GraphicObject&))'any Graphics-Operationen on %hWnd
        ~GdipDrawImageI(GraphicObject&,ImageObject&,20,0)'Bitmap draw
        'Image2 with draw
        ~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&)
        Dispose Color_Matrix#

    Endif

Endproc


Greeting Thomas

5 kB
Hochgeladen:12/07/11
Downloadcounter128
Download
5 kB
Hochgeladen:12/07/11
Downloadcounter141
Download
5 kB
Hochgeladen:12/07/11
Downloadcounter167
Download
46 kB
Hochgeladen:12/07/11
Downloadcounter166
Download
9 kB
Hochgeladen:12/07/11
Downloadcounter153
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
12/07/11  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.484 Views

Untitledvor 0 min.
p.specht12/03/20
H.Brill12/27/18
Andreas Koch09/14/15
Uwe Lang09/08/15
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie