1.VB 在桌面屏幕上画一条直线如何让它重绘?
VB 在桌面屏幕上画一条直线如何让它重绘?
'屏幕重绘 源码如下
'画多线声波色条
Public Sub DrawFrequencies(intSamples() As Integer,源码华景源码 picbox As PictureBox)
'FFT_SAMPLES =
Dim sngRealOut(FFT_SAMPLES - 1) As Single
Dim sngBand As Single
Dim hBrush As Long
Dim i As Long
Dim j As Long
Dim intRed As Integer
Dim intGreen As Integer
Dim intBlue As Integer
Dim rcBand As RECT
If UBound(intSamples) < FFT_SAMPLES - 1 Then Exit Sub
If clsFFT Is Nothing Then
Set clsFFT = New clsFourier
clsFFT.NumberOfSamples = FFT_SAMPLES
clsFFT.WithTimeWindow = 1
End If
'读入数据
For i = 0 To FFT_SAMPLES - 1 'FFT_SAMPLES =
clsFFT.RealIn(i + 1) = intSamples(i) '动态数值传送
Next
' lower band amplitudes
For i = 0 To FFT_BANDS - 1 'band(i) = 0 FFT_BANDS =
band(i) = band(i) - FFT_BANDLOWER 'FFT_BANDLOWER = 0.
If band(i) < 0 Then band(i) = 0
Next
'band(0) = 0 : band(1) = 0 : band(2) = 0 : band(3) = 0 : band(4) = 0 : band(5) = 0 : band(6) = 0
For i = 0 To FFT_SAMPLES / 2
'FFT_SAMPLES =
sngRealOut(i) = clsFFT.ComplexOut(i + 1) / (FFT_SAMPLES / 4) /
If sngRealOut(i) > FFT_MAXAMPLITUDE Then
sngRealOut(i) = FFT_MAXAMPLITUDE
End If
sngRealOut(i) = sngRealOut(i) / FFT_MAXAMPLITUDE 'FFT_MAXAMPLITUDE = 0.2
Next
j = FFT_STARTINDEX
For i = 0 To FFT_BANDS - 1 'FFT_BANDS =
For j = j To j + FFT_BANDWIDTH 'FFT_BANDWIDTH = 3
sngBand = sngBand + sngRealOut(j)
Next
sngBand = (sngBand * (Hanning(i + 3, FFT_BANDS + 3) + 1)) / FFT_BANDWIDTH
'MsgBox band(i) '--------------------------------
If band(i) < sngBand Then band(i) = sngBand
If band(i) > 1 Then band(i) = 1
j = j + FFT_BANDSPACE
Next
' draw bars
picbox.Cls
intRed =
intBlue =
'画整个色块 共块色条
For i = 0 To FFT_BANDS - 1 'FFT_BANDS = picbox.ScaleHeight =
intGreen = (band(i) * ) ' i ( 0-)
hBrush = CreateSolidBrush(RGB(intRed, intGreen, intBlue))
'画单个色块
With rcBand
.Right = i * (DRW_BARWIDTH + DRW_BARSPACE) + DRW_BARWIDTH + DRW_BARXOFF
.Left = i * (DRW_BARWIDTH + DRW_BARSPACE) + DRW_BARXOFF
'单个色块的高度 忽上忽下 DRW_BARYOFF=2 常数 band(i)自定精度数组(0-) 从小到大
'.Top = max(DRW_BARYOFF, Min(picbox.ScaleHeight, picbox.ScaleHeight - (picbox.ScaleHeight * band(i))) - DRW_BARYOFF) ' - 1)
.Top = max(2, Min(, - ( * band(i))) - 2)
.Bottom = picbox.ScaleHeight - DRW_BARYOFF
End With
FillRect picbox.hdc, rcBand, hBrush '用指定刷子填充色块区域
DeleteObject hBrush
Next
End Sub
2024-12-23 01:451007人浏览
2024-12-23 01:301751人浏览
2024-12-23 01:091434人浏览
2024-12-23 01:042201人浏览
2024-12-23 00:152777人浏览
2024-12-22 23:332666人浏览
哈瑪斯組織政治首腦哈尼雅,7月底到伊朗參加新任總統的就職典禮,並會見伊朗最高領袖哈米尼,卻成了他的再見之旅。哈瑪斯7月31日證實,哈尼雅跟一名隨扈,在伊朗首都德黑蘭遇刺身亡。哈瑪斯領袖哈尼雅 命喪德黑
1.成品网站NIKE源码1688免费:轻松打造个性商务平台!2.如何从1688网站获取成品应用源码?3.ShopEx å ECSHOP çåºå«å¨åª4.中国酒类批发网是真酒吗?5
1.windows7的源代码(win7源代码泄露)2.通达信趋势捉妖主图附图选股指标源码windows7的源代码(win7源代码泄露) 上节课作业 输入一个年月日日期,输出是星期几 程序逻