hi
I have a question about gdi level meter!
How can I use the level meter display vertical
and to appear thicker leave?
.data?
timer dd ?
hWinLevel dd ?
specdc dd ?
specbmp dd ?
specbuf dd ?
VIS_WIDTH = 84
VIS_HEIGHT = 9
bmp BITMAPINFO <>
.code
VuMeter proc hWnd:DWORD
;Vu Meter
mov bmp.bmiHeader.biSize, sizeof bmp.bmiHeader
mov bmp.bmiHeader.biWidth, VIS_WIDTH
mov bmp.bmiHeader.biHeight, -VIS_HEIGHT
mov bmp.bmiHeader.biPlanes, 1
mov bmp.bmiHeader.biBitCount, 8
mov bmp.bmiHeader.biClrUsed, VIS_WIDTH+1
mov bmp.bmiHeader.biClrImportant, VIS_WIDTH+1
invoke GetSysColor,COLOR_BTNFACE
mov bmp.bmiColors, eax ; change from RGB to BGR
mov cl, bmp.bmiColors.rgbRed
mov bmp.bmiColors.rgbBlue, cl
mov bmp.bmiColors.rgbRed, al
mov eax, 1
mov ebx, 255
.while eax <= VIS_WIDTH ; create pallete
mov bmp.bmiColors[eax*sizeof bmp.bmiColors].rgbRed, 208
mov bmp.bmiColors[eax*sizeof bmp.bmiColors].rgbGreen,47
mov bmp.bmiColors[eax*sizeof bmp.bmiColors].rgbBlue, 123
sub ebx, 2
inc eax
.endw
invoke CreateDIBSection, 0, ADDR bmp, DIB_RGB_COLORS, ADDR specbuf, NULL, 0
mov specbmp, eax
invoke CreateCompatibleDC, 0
mov specdc, eax
invoke SelectObject, specdc, specbmp
push hWnd
pop hWinLevel
invoke timeSetEvent, 25, 25, ADDR Level, 0, TIME_PERIODIC
mov timer, eax
ret
VuMeter endp
Level proc uses ebx, p1,p2,p3,p4,p5 :DWORD
LOCAL hDC :DWORD
LOCAL buffer1[12] :BYTE
invoke GetDC, hWinLevel
mov hDC, eax
mov ecx, [specbuf] ; clear window
xor ebx, ebx
.while ebx < VIS_WIDTH * VIS_HEIGHT
mov BYTE PTR [ebx+ecx], 0
inc ebx
.endw
invoke uFMOD_GetStats
mov ecx, [specbuf]
.if eax != -1 ; error?
.if ah > VIS_WIDTH ; level exceed VIS_WIDTH
mov ah, VIS_WIDTH
.endif
xor ebx, ebx
.while bl < ah ; display level
mov BYTE PTR [ebx+ecx], bl ; line 1
mov BYTE PTR [ebx+ecx+VIS_WIDTH], bl ; line 2
mov BYTE PTR [ebx+ecx+VIS_WIDTH*2], bl ; line 3
mov BYTE PTR [ebx+ecx+VIS_WIDTH*3], bl ; line 4
inc bl
.endw
ror eax,16 ; get right channel
add ecx,VIS_WIDTH*5
.if ah > VIS_WIDTH ; level exceed VIS_WIDTH
mov ah, VIS_WIDTH
.endif
xor ebx, ebx
.while bl < ah ; display level
mov BYTE PTR [ebx+ecx], bl ; line 1
mov BYTE PTR [ebx+ecx+VIS_WIDTH], bl ; line 2
mov BYTE PTR [ebx+ecx+VIS_WIDTH*2], bl ; line 3
mov BYTE PTR [ebx+ecx+VIS_WIDTH*3], bl ; line 4
inc bl
.endw
.endif
invoke BitBlt, hDC, 20,101, VIS_WIDTH,VIS_HEIGHT, specdc, 0, 0, SRCCOPY
invoke ReleaseDC, hWinLevel, hDC
ret
Level endp
example:
(http://img81.imageshack.us/img81/5640/verticalsv5.png) (http://imageshack.us)
thanks in forward
ragog