烟花特效vbs代码制作cmd(烟花特效bat代码制作)
烟花特效怎么制作
烟花的制作方法如下:
一、打开电脑,打开ps软件,新建一个图层,大小随意,黑色背景。建立横竖两条参考线,在图层中间位置。
二、新建一个图层1,前景色调为白色,选择画笔工具,围绕参考线中心点周围做圆形状的点状分布,密度情况按照自己想制作的烟花的密度情况而定。一定要围绕中心点,不能太靠近图层边缘。
三、复制图层,然后隐藏复制的图层。点击图层,滤镜--扭曲--极坐标,选择极坐标到平面坐标,确定。
四、点击图像--图像旋转--顺时针90度。点击滤镜--风格化--风。选择从左,确定,再重复这个动作两次,或者快捷键ctrl+F两次。如果效果不明显,可以多重复几次。
五、图像--图层旋转--逆时针90度。滤镜--扭曲--极坐标,平面坐标到极坐标。图层,打开混合选项,选择外发光,选择喜欢的发光颜色。
六、取消复制的图层的隐藏,打开混合选项,选择外发光,选择自己喜欢的颜色。隐藏黑色背景,合并可见图层。将制作好的烟花拖移至想要添加的图片上,可以更改方向角度和透明度,增加效果感。
微信烟花代码
微信烟花代码:
` wx.config({ debug: false, appId: '', timestamp: 0, nonceStr: '', signature: '', jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', 'translateVoice', 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'onVoicePlayEnd', 'pauseVoice', 'stopVoice', 'uploadVoice', 'downloadVoice', 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'getNetworkType', 'openLocation', 'getLocation', 'hideOptionMenu', 'showOptionMenu', 'closeWindow', 'scanQRCode', 'chooseWXPay', 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard'] }); wx.ready(function () { wx.checkJsApi({ jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'], success: function (res) { wx.onMenuShareTimeline({ title: '', // 分享标题 link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: '', // 分享图标 success: function () { $('.weixin-fireworks').fireworks({ sound: false, // sound effect opacity: 0.9, width: '100%', height: '100%' }); } }); } }); });`
拓展:
烟花代码是一种很有趣的特效,主要是使用jQuery插件来实现,可以在微信中实现一些烟花效果,这是一种很有趣的可视化效果,可以在微信中实现不同的烟花效果,比如烟花爆炸、烟花喷射等,可以给用户带来不同的视觉体验。
vb怎样做礼花绽放的效果,求程序代码。
用记事本生成以下四个文件,再到VB中新建一个工程,加入这4个文件,就可以看到礼花绽放效果。
CExplosion.cls文件内容:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CExplosion"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' CExplosion - Basically a collection of CFrags.
Option Explicit
Private m_Col As Collection
Private m_hDC As Long
' X and Y are the start position.
' How many frags do you want?
Public Sub Setup(x As Single, y As Single, FragCount As Integer, Gravity As Single, hDC As Long)
Dim i As Integer
Dim frag As CFrag
Dim Direction As Single, vel As Single
Set m_Col = New Collection
For i = 1 To FragCount
Set frag = New CFrag
Direction = Rnd * (2 * pi)
vel = (Rnd * 20) + 10
frag.Init x, y, Direction, vel, Gravity
m_Col.Add frag
Next i
m_hDC = hDC
End Sub
' Move and draw the frags.
Public Function Move() As Boolean
Dim frag As CFrag
Dim DeadCount As Integer
For Each frag In m_Col
With frag
If Not .Move Then DeadCount = DeadCount + 1
Ellipse m_hDC, .x - 2, .y - 2, .x + 1, .y + 1
End With
Next frag
Move = Not (DeadCount = m_Col.Count)
End Function
CFrag.cls文件内容:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CFrag"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' CFrag - Represents a flying object with velocity and direction.
' From this it can work out a path of co-ordinates.
' Basic trigonometry is used.
Option Explicit
Private m_Direction As Single ' In Radians.
Private m_Velocity As Single
Private m_Gravity As Single ' Make it fall towards bottom of screen.
Private m_X As Single, m_Y As Single
' Setup the object.
Public Sub Init(XStart As Single, YStart As Single, Direction As Single, Velocity As Single, Gravity As Single)
m_Direction = Direction
m_Velocity = Velocity
m_Gravity = Gravity
m_X = XStart
m_Y = YStart
End Sub
' Move the object along its path.
Public Function Move() As Boolean
m_Velocity = m_Velocity - 1 ' Decrease speed.
If m_Velocity 0 Then
m_X = m_X + (m_Velocity * Cos(m_Direction))
m_Y = m_Y + (m_Velocity * Sin(m_Direction)) + m_Gravity
Move = True
' Else it has stopped.
End If
End Function
Public Property Get x() As Single
x = m_X
End Property
Public Property Get y() As Single
y = m_Y
End Property
CTrail.cls文件内容:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CTrail"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' CTrail - Display a trail of dots for a set length.
Option Explicit
Private m_Direction As Single
Private m_Length As Integer
Private m_hDC As Long
Private m_X As Single, m_Y As Single
Public Sub Init(x As Single, y As Single, Direction As Single, Length As Integer, hDC As Long)
m_X = x
m_Y = y
m_Direction = Direction
m_Length = Length
m_hDC = hDC
End Sub
Public Function Move() As Boolean
If m_Length 0 Then
m_Length = m_Length - 1
m_X = m_X + 10 * Cos(m_Direction)
m_Y = m_Y + 10 * Sin(m_Direction)
Sparkle m_X, m_Y
Move = True
Else
Move = False
End If
End Function
' Draw a random splatter of dots about x,y.
Private Sub Sparkle(x As Single, y As Single)
Dim i As Byte
Dim nX As Single, nY As Single
Dim angle As Single
For i = 1 To (Rnd * 5) + 3
angle = Rnd * (2 * pi)
nX = x + (3 * Cos(angle))
nY = y + (3 * Sin(angle))
Ellipse m_hDC, nX - 1, nY - 1, nX + 1, nY + 1
Next i
End Sub
Public Property Get x() As Single
x = m_X
End Property
Public Property Get y() As Single
y = m_Y
End Property
frmExplode.frm文件内容:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
VERSION 5.00
Begin VB.Form frmExplode
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
FillStyle = 0 'Solid
LinkTopic = "Form1"
ScaleHeight = 213
ScaleMode = 3 'Pixel
ScaleWidth = 312
StartUpPosition = 3 'Windows Default
WindowState = 2 'Maximized
Begin VB.CommandButton cmdExit
Caption = "Exit"
Height = 375
Left = 3000
TabIndex = 2
Top = 2520
Width = 1215
End
Begin VB.CommandButton cmdClear
Caption = "Clear"
Height = 375
Left = 1680
TabIndex = 1
Top = 2520
Width = 1215
End
Begin VB.PictureBox Picture1
BackColor = H00000000
FillStyle = 0 'Solid
Height = 2295
Left = 120
ScaleHeight = 149
ScaleMode = 3 'Pixel
ScaleWidth = 301
TabIndex = 0
Top = 120
Width = 4575
End
Begin VB.Timer tmrMove
Enabled = 0 'False
Interval = 10
Left = 4080
Top = 120
End
End
Attribute VB_Name = "frmExplode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Explosion - Simulate fireworks on your PC. Just click on the black box!
Option Explicit
Private explosion As CExplosion
Private trail As CTrail
Private bExplode As Boolean
Private Sub cmdClear_Click()
Picture1.Cls
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Form_Resize()
' Keep everything looking good.
Dim h As Single
On Error Resume Next
h = ScaleHeight - cmdClear.Height
Picture1.Move 0, 0, ScaleWidth, h
cmdClear.Move 0, h
cmdExit.Move 0 + cmdClear.Width, h
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Not tmrMove.Enabled Then
' Create a new trail...
' Choose a color from a list.
Picture1.ForeColor = Choose(Int(Rnd * 5) + 1, vbRed, vbWhite, vbCyan, vbGreen, vbYellow)
Picture1.FillColor = Me.ForeColor
Set trail = New CTrail
' Choose random direction from 255 to 344
trail.Init x, y, Radians(Int(Rnd * 90) + 225), Int(Rnd * 30) + 20, Picture1.hDC
tmrMove.Enabled = True ' Timer will handle drawing.
End If
End Sub
Private Sub tmrMove_Timer()
' Note that the move functions also draw.
' They return false when the object no longer is moving.
If trail.Move = False And bExplode = False Then
' The trail has stopped so explode.
bExplode = True
Set explosion = New CExplosion
explosion.Setup trail.x, trail.y, Int(Rnd * 30) + 10, 9, Picture1.hDC
End If
If bExplode Then
If explosion.Move = False Then
' Reset for a new explosion!
tmrMove.Enabled = False
bExplode = False
End If
End If
End Sub
' Simple function to convert degrees to radians.
Private Function Radians(sngDegrees As Single) As Single
Radians = sngDegrees * pi / 180
End Function
modStuff.bas文件内容:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Attribute VB_Name = "modStuff"
Option Explicit
' To get Pi type "? 4 * Atn(1)" in the immediate window,
' copy the result into code!
Public Const pi = 3.14159265358979
Public Declare Function Ellipse Lib "gdi32" (ByVal hDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
cmd烟花代码?
@echo off
color 2
title 烟花效果
:loop
echo %random%%random%%random%%random%%random%%random%%random%%random%
goto loop
使用方法:
打开命令提示符(Command Prompt)。
复制上面的代码,粘贴到命令提示符中。
按下回车键,即可在屏幕上看到烟花效果。