Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
teava rezistenta panou apa calda

Sub mobila de bucatarie si sub fr...

Rezultat RMN

Numar circuite IPAT si prindere t...
 Pareri brgimportchina.ro - teapa ...

Lucruri inaintea vremurilor lor

Discuții despre TVR Sport HD

Cost abonament clinica privata
 Tremura toata, dar nu de la ro...

Renault Android

Recomandare bicicleta e-bike 20&#...

Bing-Content removal tool
 Nu pot accesa monitorulsv.ro de l...

Cum sa elimini urmele de acnee?

Wc Geberit

Routere detinute in trecut si in ...
 

BitBlt diagonal roll over effect

- - - - -
  • Please log in to reply
4 replies to this topic

#1
elbert

elbert

    Junior Member

  • Grup: Members
  • Posts: 75
  • Înscris: 31.08.2012
Hello!
I have a little big problem about how can I move a picture on the diagonal (roll over effect).
I attached the example of roll over effect from right to left.
So how is done diagonally effect?
Any ideas are welcome. Thank you very much!

Attached Files



#2
have_dreams

have_dreams

    Member

  • Grup: Members
  • Posts: 627
  • Înscris: 01.06.2010
Hey elbert,
   All I wanted to do is just to translate your problem. This way somebody will help you...maybe:D

"Am o mica mare problema in legatura cu mutare unei imagini in diagonala (efectul roll over).
Am atasat un exemplu de efect rollover de la dreapta la stanga.
Asa ca, are cineva nist idei cum se obtine acest efect?
Toate ideile sunt bine-venite. Multumesc mult!"

#3
elbert

elbert

    Junior Member

  • Grup: Members
  • Posts: 75
  • Înscris: 31.08.2012
Am o problema in legatura cu deplasarea unei poze pe diagonala intr-un picturebox (efectul roll over).

Am atasat un exemplu foarte concludent de efect roll over de la dreapta la stanga a unei poze intr-un picture box.

Cum se obtine acest efect pe diagonala?

Multumesc!

#4
RAZ

RAZ

    Member

  • Grup: Members
  • Posts: 1,227
  • Înscris: 15.10.2004
@elbert: Data viitoare scrie pe romaneste de la inceput, nu veni cu copy-paste de pe alte forum-uri, lene Posted Image


Uite cum faci in toate directiile la MouseDown+MouseMove (drag) pe pictbox (copiaza la tine in form1 tot  ca o sa-ti mearga):

Option Explicit
Private Declare Function BitBlt Lib "gdi32" _
(ByVal desthdc As Long, ByVal destX As Long, ByVal destY As Long, _
ByVal destWidth As Long, ByVal destHeight As Long, _
ByVal srchdc As Long, ByVal srcX As Long, ByVal srcY As Long, ByVal rOp As Long) As Long
Dim mdx As Single, mdy As Single
Dim mx As Single, my As Single
Dim lx As Single, ly As Single
Dim dragging As Boolean

Private Sub pic1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lx = X
ly = Y
mdx = X
mdy = Y
mx = 0: my = 0
End Sub

Private Sub pic1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
	 dragging = True
	 mdx = X
mdy = Y
Else
	 dragging = False
End If

End Sub

Private Sub waves_Timer()
Static xval As Long
Static yval As Long
Dim EndScrollX As Long
Dim EndScrollY As Long
	
EndScrollX = Picture1.ScaleWidth - xval
EndScrollY = Picture1.ScaleHeight - yval

BitBlt pic1.hDC, 0, 0, EndScrollX, EndScrollY, Picture1.hDC, xval, yval, vbSrcCopy
BitBlt pic1.hDC, 0, EndScrollY, EndScrollX, yval, Picture1.hDC, xval, 0, vbSrcCopy
BitBlt pic1.hDC, EndScrollX, 0, xval, EndScrollY, Picture1.hDC, 0, yval, vbSrcCopy
BitBlt pic1.hDC, EndScrollX, EndScrollY, xval, yval, Picture1.hDC, 0, 0, vbSrcCopy
	

mdp:

If dragging Then
	 mx = lx - mdx
	 lx = mdx
End If

xval = xval + mx
If xval < 0 Then xval = xval + Picture1.ScaleWidth
If xval > Picture1.ScaleWidth Then xval = xval - Picture1.ScaleWidth

If dragging Then
my = ly - mdy
ly = mdy
End If

yval = yval + my
If yval < 0 Then yval = yval + Picture1.ScaleHeight
If yval > Picture1.ScaleHeight Then yval = yval - Picture1.ScaleHeight

pic1.Refresh

End Sub


(sursa)

#5
elbert

elbert

    Junior Member

  • Grup: Members
  • Posts: 75
  • Înscris: 31.08.2012
Acum am probleme cu efectul flicker, poti sa te uiti la fisier te rog?
Multumesc!

Attached Files



Anunturi

Bun venit pe Forumul Softpedia!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate