Home > Software engineering >  VB jQuery image switching effect
VB jQuery image switching effect

Time:09-28

VB jQuery image switching effect it difficult? Why jQuery inside a lot of cool effect to implement very simple? VB or.net, etc which language to realize the image effect is very convenient? Introduce o master, feel the VB realize the effect is very difficult, want to learn a language easier to implement, support a move please (mainly used for the desktop application design)
Such as the following effects:
http://www.5icool.org/demo/2011/a00519/index4.html
http://www.beifengwang.com/js/1082_kan.shtml

CodePudding user response:

Only the IE browser, can not see what is the 3 d effect,
Simulation of the first link horizontal slip, the images are downloaded to the project directory,
 'form to add 2 CommandButton, a PictureBox, a Timer control,' 
Option Explicit

Const IMAGE_WIDTH As Long=700
Const IMAGE_HEIGHT As Long=420
Const SLIDE_STEP As Long=140

Private m_ID As Long
Private m_thisImg As IPictureDisp
Private m_prevImg As IPictureDisp
Private m_thisX As Long
Private m_prevX As Long
Private m_Step As Long

Private Sub LoadImage ()
The Set m_prevImg=m_thisImg
The Set m_thisImg=LoadPicture (App) Path & amp; "" & amp; M_ID & amp; ". JPG ")
End Sub

Private Sub ShowImage ()
Picture1. PaintPicture m_thisImg, m_thisX, 0
If Not m_prevImg Is Nothing Then
Picture1. PaintPicture m_prevImg, m_prevX, 0
End the If
End Sub

Private Sub StartSlide ()
Timer1. Enabled=True
Command1. Enabled=False
Command2. Enabled=False
End Sub

Private Sub StopSlide ()
Timer1. Enabled=False
Command1. Enabled=True
Command2. Enabled=True
End Sub

Private Sub Command1_Click ()
M_ID=((m_ID - 2 + 6) Mod 6) + 1
LoadImage
M_thisX=IMAGE_WIDTH
M_prevX=0
M_Step=- SLIDE_STEP
StartSlide
End Sub

Private Sub Command2_Click ()
M_ID=(m_ID Mod 6) + 1
LoadImage
M_thisX=- IMAGE_WIDTH
M_prevX=0
M_Step=SLIDE_STEP
StartSlide
End Sub

Private Sub Form_Load ()
Me. The ScaleMode=vbPixels

Picture1. The ScaleMode=vbPixels
Picture1. BorderStyle=vbBSNone
Picture1. Width=IMAGE_WIDTH
Picture1. Height=IMAGE_HEIGHT

Command1. Caption="& lt;"
Command2. Caption="& gt;"
Timer1. Enabled=False
Timer1. Interval=56

M_ID=1
LoadImage
End Sub

Private Sub Picture1_Paint ()
ShowImage
End Sub

Private Sub Timer1_Timer ()
M_thisX=m_thisX + m_Step
M_prevX=m_prevX + m_Step
If (m_thisX=0) Or (Sgn (m_thisX)=Sgn (m_Step)) Then
M_thisX=0
The Set m_prevImg=Nothing
StopSlide
End the If

ShowImage
End Sub

CodePudding user response:

I mean a little 3 d, or image distortion, distortion switching effects, such as
http://js.itivy.com/jiaoben1374/index.html

CodePudding user response:

Can't see the 3 d, but generally the deformation of rectangle in 3 d view with API StretchBlt can ah,

CodePudding user response:

The
reference 3 floor Tiger_Zhao response:
can't see the 3 d, but generally the deformation of rectangle in 3 d view with API StretchBlt can ah,

Can use StretchBlt 3 d deformation? Mean can draw pictures into trapezoidal, such as arbitrary quadrilateral open? I don't know ah, have example eldest brother?

CodePudding user response:

Is wrong, PlgBlt
Examples of parallelogram: http://planet-source-code.com/vb/scripts/ShowCode.asp? TxtCodeId=13868
The principle of the trapezoidal: PlgBlt

CodePudding user response:

reference 5 floor Tiger_Zhao reply:
, a fault is PlgBlt
Examples of parallelogram: http://planet-source-code.com/vb/scripts/ShowCode.asp? TxtCodeId=13868
The principle of the trapezoidal: PlgBlt


Oh, oh, thanks, I just want to imitate a jQuery effect of image to open the door, another day done coming to share with everyone! Hey hey,

CodePudding user response:

This use VB to write a little complicated...

The operation of the key is "3 d perspective", the "vertex coordinates" calculation, quite tedious,


However, looking forward to your masterpiece,

CodePudding user response:

This, if you can call DirectX 3 d interface to do, may be a little easier,

CodePudding user response:

reference 5 floor Tiger_Zhao reply:
, a fault is PlgBlt
Examples of parallelogram: http://planet-source-code.com/vb/scripts/ShowCode.asp? TxtCodeId=13868
The principle of the trapezoidal: PlgBlt


But seemingly PlgBlt is used to draw a parallelogram, cannot draw trapezoid and arbitrary quadrilateral oh...

CodePudding user response:

See schematic diagram,
Trapezoidal upper triangular and lower triangular respectively belong to two parallelogram after deformation, add up to is trapezoidal,
  • Related