Jump to content

Smart phone style background png slide....


davidkim
 Share

Recommended Posts

Smart phone style background png slide....

mouse drag move left / right

slide....

slide3.zip

Posted Image

Posted Image

bug patch => right move ...image blank..

Edit Func

Func WM_SETCURSOR($hWnd, $iMsg, $iWParam, $iLParam)
$iLParamhigh = BitShift($iLParam, 16) ;HiWord
$iLParamlow = BitAND($iLParam, 0x0000FFFF) ;LoWord
If $hWnd = $GUI And $iLParamlow = 1 And $iLParamhigh > 512 Then
Switch $iLParamhigh
Case $WM_LBUTTONDOWN
If $now_xPos > 1920 Then $now_xPos -= 1680
$np2 = $now_xPos
Case $WM_LBUTTONUP
If $np2 > 1920 Then $np2 -= 1680
If $np2 < -240 Then $np2 += 1680
$now_xPos = $np2
             ;Next mouse button down ....
$x1 = 0
$x2 = 0
EndSwitch
EndIf
EndFunc ;==>WM_SETCURSOR

Func _freeView($x1)
If $x1 <> $thisXpos Then
$thisXpos = $x1
Local $hGraphic, $hImage
$hImage = _GDIPlus_ImageClone($gui_png)
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
     If $x2 = 0 Then $x2 = $x1 ; first click is non action
If $x2 > $x1 Then
$gap = $x2 - $x1
$x2 = $x1
$np2 += $gap; int( Round($gap * 2,0) ) < ==move speed..
$now_xPos = $np2 ; now background position backup
ElseIf $x2 < $x1 Then
$gap = $x1 - $x2
$x2 = $x1
$np2 -= $gap
$now_xPos = $np2 ; now background position backup
ElseIf $x1 = $x1 Then
     ConsoleWrite(' first click' & @CRLF)
EndIf

If $np2 > (1680-240) Then ; // if background move left..over
         $new = $np2 - 1680 ;; background position is over background width
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $slide_png, $np2, 0, 240, 337, 26, 84, 240, 337)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $slide_png2, $new, 0, 240, 337, 26, 84, 240, 337)
     ElseIf $np2 > -1679 Then    ; // if background move right..over
     $minusX = 1680
     $new = $np2 + $minusX
     ConsoleWrite('$np2:' & $np2 & ' new:' & $new & @CRLF)
     _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $slide_png, $np2, 0, 240, 337, 26, 84, 240, 337)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic, $slide_png2, $new, 0, 240, 337, 26, 84, 240, 337)
Else
     _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $slide_png, $np2, 0, 240, 337, 26, 84, 240, 337)
EndIf
_WinAPI_UpdateLayeredWindowEx($GUI, _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage), 255, 1)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
EndIf
EndFunc ;==>_freeView

change this func.....

add code... If $np2 < -240 Then $np2 += 1680

change code... ElseIf $np2 > -1679 Then ; // if background move right..over

Edited by davidkim

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

Interesting !

but drag and move fails...

it return to background 1 if i click on background 2 or 7 :mellow:

test by windows 7 ... test ok...

are your use os?

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

Always drag and move problems mainly with touch pad. :(

do not test was touch pad..

this source is mouse drag / mouse up / mouse down sample....

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...