Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Create A Meter/gauge On A Form?


Hi,
I want to represent a percent value from 0 to 100 as an analog meter or gauge on a form.
I'm thinking I have to use the Line function to create the needle and Circle to create the arc.

Any ideas or suggestions will be greatly appreciated.

Thanks,
Al.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
To Create Volume Meter ?
I'm now writing a project to scan the loudness of wave out and adjust the master volume automatically.
I have a difficulty on scan the volume loudness.
Is there anyone know how to create a volume meter to show the loudness of the wave out?

Couldn't Get Waveout Meter, Couldn't Get Wavein Meter!
Hi I've run a visualization program in VB and the VB say Couldn't get waveout meter.
Anyone know what's the problem?

And there is a program in VB too that have the same problem ... couldn't get wavein meter and waveout meter. Thanks

Here is the URL of the program that I download :
http://www.planet-source-code.com/vb...p%2FC107503481

Gauge
Hey all, i'm trying to do the following and can get 'half way' there. I would like to create a gauge control in VB. I want the gauge control to look like the RPM gauge of the Honda S2000:

As you can see, the gauge arcs...I considered using individual pictureboxes for each LED that lights up in the gauge...as they don't flicker like shapes do when changed quickly...but I am unable to get the picturebox to arc like that...I just get picture boxes that arc (all standing up and down), instead of arcing and fanning out like the LED pictures.

Can anyone else think of a way of doing this without using individual pictureboxes?

Help With A Gauge OCX
Does anyone know where I can download a free gauge ocx or is it easily possible to create one?

Help On Bar And Gauge Plotting
i need help on doing something on vb6. i need to print (on paper) 3 bars(horizontal) side by side with 3 different colors. the first bar will be green, then, yellow, then, red. then, on the bar, i need to print an arrow or an upside down triangle like a pointer, which will be placed somewhere on those bars depending on the value of a variable that will correspond to that arrow. i got 3 vb books at home and none of them have the thing i needed to accomplish this certain task. if anyone can help me out, i'll really appreciate it. go to this link and you'll find the sample of the picture: http://www.geocities.com/kleighdy

Me And My Dial Gauge Again ....
My gauge is working ... sort off.
I get the needle to go where I want it to go (thanks guys) but here is my newest problem.

I move the needle in increments of 1 degree to its new position ... but I only see the needle when it is in its final position ... I would like to it "animated" with a nice smooth movement.

This is what I'm using to move the line: (Needle is a line object)

Needle.X2 = (New position)
Needle.Y2 = (New Position)

and I loop this until it is in its correct position. I thought the PC was to quick for me to see it so I built in some delays but still, I see it in in starting position and then in its final position, nothing in between.

Again, can somebody help me with this?

Analog Gauge ***RESOLVED**
I found the following code on this site. There is a picure box with a circle inside and the same size as the picturebox. By changing the percentage, it looks like a neelde moving on an analog gauge. I was wondering if it is possible, as the needle moves in a clockwise direction, that the backcolor of the circle to the left of where the needle passes changes. Perhaps it could be done with Picture1.Circle.
VB Code:
Option Explicit Const PI = 3.14157Public start As SinglePrivate Function calcX(radius As Single, angle As Single) As Single    calcX = radius * Cos(angle)End FunctionPrivate Function calcY(radius As Single, angle As Single) As Single    calcY = radius * Sin(angle)End Function   Private Function degToRad(degrees As Integer) As Single degToRad = degrees * PI / 180 End Function Private Sub drawNeedle(percentage As Single)    Picture1.Cls    Dim x As Single    Dim y As Single    Dim i As Integer    Dim r As Single 'radius of arc in this instance it's the length of the needle    Dim centreX As Single    Dim centreY As Single    Dim offset As Integer 'this sets where the line starts from         r = Picture1.Height / 2        centreX = Picture1.Width / 2    centreY = Picture1.Height / 2        offset = 180        i = 360 / 100 * percentage 'convert percentage to degrees            x = calcX(r, degToRad(i + offset)) + centreX    y = calcY(r, degToRad(i + offset)) + centreY    ' PSet (x, y)            Picture1.Line (centreX, centreY)-(x, y), vbWhite 'RGB(255, 0, 0)     End Sub

Where Can I Find A Gas Gauge Control??
I was wondering where I might find a gas gauge control???

Pressure And Temp Gauge Controls
anyone know where i can get a good freeware control that allows me to display a thermomer and temp gauge on a form and adjust their display (temp and press) programatically?

any help greatly appreciated!

Show Percent And Gauge Reading Text File
Hi

How can I show percent and a gauge when I read text file, I has that show the percent read of the file


thank you in advance

Visual Basic Gauge Tick/colored Area
I am trying to find out how to make a gauge tick marks.
 I know how to do the needle movement but i am trying to do redline area, yellow line area green area around the outer edge on the gauge. Also variable tick marks.
 I am also wanting to make them movable. To be able to set the areas up like 0 to 100 will be red and so on.

Any help would greatly be appreciated. Even a good book that can enlighten me on this subject.

Thank you,
Merlin Knight

Hey Gurus, Throw Me A Life Raft, I Need Help {gauge Based On Mouse Coordinates}
*sign* I would need big help from you gurus, trying to converting codes from mouse values into program offset value. I know this is going to be long one
and maybe very confusing, but if you know something please at least try to help
But here let me clearly explain this to you. First I have been able to draw a circle. circle filling (pie wedge) and a line as if its a "gauge" with needle. I use mouse move value with scale of 200 using picturebox property, so say if mouse scale is at 0 then the line "needle" is resting at 0, as I swerve mouse inside picture box, the value changes up to 200 and it gets line to sweep around the circle same time the "filling" pie wedge would follows the line "needle". And technically that's my first and basic prodecure on "getting to know how" to draw a circle with a line at center to end point, and pie wedge that gets to fill in with move value.
Now, I am about to move up... I wanted to convert the value of mouse move into a simulator program's (flight simulator) value. It applies same way as move move but a little different. I have already wrote a code and module allowing communication between simulator program to vb which allows it read assigned offset value from simulator program. Now let's not worry about this part, I am only worry about converting mouse move value into simulator program.


Let say the code look at the code example here:

This is not my code that was the example given from my friends, and he stated that it worked through program so I suppose that is how it should look:



Code:
Dim OilPress As Long
Dim OilPressAngle As Long
Dim dwResult As Long

Call FSUIPC_Read(&H8BA, 2 , VarPtr(OilPress),dwResult)
Call FSUIPC_Process(dwResult)
'FSUIPC is a code written allowing communication progress between VB
'program and simulator program *Note* &H8BA, 2 this is offset value of oil
'pressure from sim program and it has 2 bits.

If OilPress < 60 Then
OilPressAngle = 0 - ((60 - OilPress) * 0.75)
PicOil.CLS
Else
OilPressAngle = ((OilPress - 60) * 0.75)
PicOil.CLS
End If

If OilPress < 60 Then

OilPressAngle = 0 - ((60 - OilPress) * 0.75)

Else

OilPressAngle = ((OilPress - 60) * 0.75)

End If

' On the gauge, 60 psi is a needle angle of zero, or horizontal. The 0.75
' is a factor to make the angle of the needle match the markings on the
' gauge face. This will be different for every gauge.

OilPressAngle = OilPressAngle * (3.1412 / 180)
' Converts the angle from Radians to Degrees

picOil.CurrentX = 1500
picOil.CurrentY = 750

' Sets the center of the needle to the center of the gauge.' picOil is
' the picturebox that has the image of the gauge as its background

picOil.Line Step(0 - (500 * Cos(OilPressAngle)), (0 - (500 * Sin(OilPressAngle))))-Step(0 - (250 * Cos(OilPressAngle)), (0 - (250 * Sin(OilPressAngle))))

' Uses trig to calculate the start and end points of a line at an angle of
' OilPressAngle from 250 twips from the center of the gauge to 500
' twips from the center of the gauge
Now This is the one I would need to know how to convert from mouse value into simulator offset value, if you can help, and tell me which of these lines needs to be replaced as values:


Code:
Const cx1 = 200, cy1 = 150


Private Sub Form_Load()

AutoRedraw = True
ScaleMode = vbPixels
BackColor = vbWhite
Width = 600 * Screen.TwipsPerPixelX
Height = 600 * Screen.TwipsPerPixelY
FillStyle = vbFSSolid
Picture1.Move 284, 400, 200, 30
Picture1.ScaleWidth = 200

Const Deg2Rad = 3.14159 / 180#
Dim dx As Long, dy As Long
Dim fx As Long, fy As Long
Dim da As Long
Dim CircFill As Long, BoxFill As Long

Dim LeftN1Angle As Long, LeftN1 As Long
Dim LEGTAngle As Long, LeftEGT As Long
Dim RN1Angle As Long, RightN1 As Long
Dim REGTAngle As Long, RightEGT As Long
Dim dwResult As Long

*this code is a how it should be written to communicate with simulator game
'let say &H898 will give range from 0-16384 as if mouse giving range from 0-200 don't worry about this code below:

Call FSUIPC_Read(&H898, 2, VarPtr(LeftN1), dwResult)
Call FSUIPC_Process(dwResult)

'This is what I need to convert... make a line move if value from simulator program is equal to, greater, or less than. Probablly need to replace 'X' or Picture1.scale with simulator offset

If button = 1 Then
Line (cx1 - 100, cy1 - 100)-Step(420, 500), vbBlack, BF
If X > Picture1.ScaleWidth Then X = Picture1.ScaleWidth
If X < 0.1 Then X = 0.1

If X < 0 Then

If X > 190 Then
CircFill = vbRed
BoxFill = vbRed
Else
CircFill = RGB(128, 128, 128)
BoxFill = vbBlack
End If

dx = Cos(X * Deg2Rad) * 65
dy = Sin(X * Deg2Rad) * 65
da = (360 - X) * Deg2Rad

FillColor = BoxFill
Me.Line (cx1, cy1 - 29)-Step(75, 25), vbWhite, B

FillColor = CircFill
Me.DrawWidth = 2
Me.Circle (cx1, cy1), 65, vbBlack, -da, -359.99 * Deg2Rad
Me.Circle (cx1, cy1), 65, vbWhite, 160 * Deg2Rad, 359.99 * Deg2Rad

DrawWidth = 3
Line (cx1, cy1)-Step(dx, dy), vbWhite

End If
Me.Refresh


End Sub

If you have any idea or were able to help me out, I would be very appreciated.

Create Form Using VBA Or Create Form During Runtime
hi there..
i'l ask an apology if you found i'm posting in the wrong section, but i could not find where is the exact location to post this topic.

we're using an ERP program and the only way to change/modify the forms is through VBA. Now we're going to make new form consisting 4 textboxes and 2 command buttons through VBA codes..

or in just simple VB codes, create form during runtime including 3 textbox and 2 command buttons.


if you have an idea please post it here. it' would be a great help for us.

Thank you in advance.

VU Meter
I would like to make a little VU Panel Meter control for a little project I am doing. The final effect is supposedly something like these kinds of panel meters: http://www.deree.com.tw/images/de860f-vu.gif .
The problem is that I cannot think of any way at all to calculate the coordinates of the needle ends on the edges of two circle sectors. I need to have a function that will have the input of a percentage/value of some kind that will return 2 sets of coordinates that are for the ends of the line that will be drawn for the needle and this is the thing that I have absolutely no idea how to do.
Any input is appreciated
Thanks

VU Meter?
Hello, is there anyway FREE way of applying a VU meter (or audio level meter) into an MP3 player? If so can you give me any URL's to them where it does actually measure the audio output, cos i have had some previously and they don't actually measure the output or i have been coding them wrong.

Thanx in advance

VU Meter
Is there any OCX controls out there that will provide me a VU meter?

Vu Meter
dear all,

i need to add a small VU LED indicator when recording with a microphone, just some simple LED that show the recording volume. i tried looking around at examples but found nothing for this, just some VU meters on audio playback.

anyone has a good starting point for this...?

thanks,

wc.

VU Meter
I had search for VU meter's tutorial and source code, but none of them can be used. I use windows media player control and I want to add a VU meter and equalizer meter to my program. But how?

UV Meter In VB ?
Hi

Is there any of you who know how to make a UV meter
in VB. For those who don't know what a UV meter is.
Is a meter to display the amplitude of sound.


Hope you can help.

Chris Davidsen

VU-METER?
How do I make a VU-METER that works in win XP?
Is there any dll or ocx that is free and can help me?



Edited by - henrikjohansson on 3/28/2002 9:15:42 AM

VU Meter
An article posted on CodeGuru lead me to a page that had a download of a source code for getting the volume output (used for winamp's VU Meter). For some reason it won't work. It says my system doesn't support it, but winamp works fine. it uses things like the API Function MixerGetControlDetails. The mixer control won't initialize or something. If this is what winamp uses, how come it doesn't work and winamp does? Any help would be greatly apreciated, thanx

DUN And Net Meter
I have prepared a project for an Internet meter.
I want the meter to run when DUN[Dial Up Networking]
starts.I already have the code for that and have placed the project icon in system tray.
The problem is that if DUN starts the meter does not do anything.
How should I tell my program when DUN has started and when it has ended

Peak Meter
Im not familiar with api functions I was wondering if any one knows how get peak values from you system mixer I know its simple compared to c++ language but i never understood how to use them

Bandwidth Meter
Hi,

In a recent post by Dex, I clicked on the link in his signature pertaining to his Download Meter app. I must admit, I really liked this program and I would like to create a program of my own that is similar to Dex's. I was wondering how involved is a program like this and how complicated does it get? What sort of controls do I need to use when creating a program like this and do all of them come standard in VB 6?

Download With Meter
I have made an autoupdate program and it works ok...
I used the URLDownloadToFile API for downloading the files.

My problem is the following.. I want to make a metter that will show me the downloading status. (ex. 100.2kb/2 MB downloaded so far).
Can you point to the right direction?

Volume Meter
i am trying to write a volume meter (atcualy i want to use similar code to graph out the ups and downs to visualize an mp3)

however the following line of code always fails for me
ok = GetControl(hmixer, MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT, MIXERCONTROL_CONTROLTYPE_PEAKMETER, outputVolCtrl)

I assume its because the mixer I have doesnt support the outputVolCtrl
I was using the onboard sound of my MB. the mixer was a c-media mixer

So.. in order to try and solve it i installed my old sound blaster live 5(basic)
card. Still no luck.

My concern is that I want to distribute this app. how many other people will this end up failing for. And shouldnt my sound blaster live be able to support this??

ALso which would be a big help, is there another way around this. Some sort of software or control that would do this without the use of hardware?

Wav Output Meter
Hello!

How can i make output meter for both left and right channels?
is there any API ways to do it?

Help me plz

Looking For Audio Vu Meter
I developed a sound recorder. Now should it be nice when there is a vu-meter on it, so I can monitor the input signal which I will record.

Have someone any idee how I can do that?

Equalizer /VU Meter
Anyone know how to make a good WORKING Equalizer/VU Meter, Im using mciSend commands with winmm.dll. Every thing I have tried thus far doesnt work. Any help would be greatly appreciated.

DirectX VU Meter Help
I am trying to put a VU meter in my MP3 player but I have no clue where to start. If possible I would like to build my own but if it is too advanced then I will place a pre-built VU meter on my form. If someone could give me some direction on either building my own or finding some source code that would be appreciated. Thank you. Jay.

Resource Meter
Does anybody know what are the "resources" that the 3 fields in the system resource meter refer to?

Sound Meter
Hi, I need help with adding a sound meter which will measure and show the mic and sound levels. Please can anyone tell me how to do this or where I can find sample code for this.

Volume Meter
i used mediaplayer for playing mp3 files the problem is when i play the song and doubleclick on volume which is come with windows 95/98 it's right bottom on screen it has Wave control meter but it's not moving but when i play song from winamp that wave control meter it's working it moves so how would i make that volume meter to move with MediaPlayer.

ISP Usage Meter
Hi



I want to write a simple program that monitors my internet usage throught my
ISP ie mb downloaded and uploaded.

How would I go about this?



Thanks Steve

WaveOut Meter
Hi,
I am trying to make a program that will act like a VU meter for anything that comes out of my soundcard.
I have found various codes on the net to do this,
but they all error out with "can't get wavein/out meter" or unable to start capture device.
does anyone know why i would get this error?
could it be something to do wiht windows 2000?
thanks,
jollygreengiant

Wave Out Meter?
Hello Folks

I have a doubt.I have just finished writing a small media player and I want to add a VU meter like stuff to it.I tried using some stuff form the net but I am getting an error message which reads as : "Couldn't get waveout meter".I have a Yamaha DXSG sound card and Winamp works perfectly normal.Alternatively which sound cards support such a functionality?Will someone help?

Kumar


Code ..Debug ..Go Home

PROGRESS METER
I HAVE THIS CODE TO COPY ONE FILE TO ANOTHER DIRECTORY AND WOULD LIKE TO ADD A PROGRESS METER TO MY FOM BUT I DONT KNOW HOW OR WHAT CODE I SHOULD USE FOR IT.
private Sub Form_Load()
Label1.Caption = "Internal Database Backup Program"
Command1.Caption = "Backup Now"
Form1.BackColor = vbBlue
Label1.ForeColor = vbRed
Label1.FontSize = 12
Label1.FontBold = true
End Sub
private Sub command1_click()
Dim stSource as string
Dim stDest as string

stSource = "\MarkiisharedAccess filesRegistersANDY DATABASESecure Secure CUSTOMER.mdb"
stDest = "C:my documentsdatabase back-upsecure secure customer.mdb"

FileCopy stSource, stDest
End Sub



I WOULD LIKE TO BE ABLE TO SEE A PROGRESS METER FOR WHEN THE PROGRAM IS RUNNING. I AM VERY NEW TO VB AND AM TRYING TO TEACH MYSELF AS MY COMPANY ARE NOT INTERESTED IN HELPING ME WITH TRAINING SO ANY HELP WOULD BE USEFUL

Thanks in advance for any help in this matter

Sound Meter
hi,
i need to display the waveform of a wavefile while it's playing. How can i do this. Please anyone help me with this.

Circular Health Meter
Hi! I've just picked up VB and find it interesting. Read through a few threads but the terms used are just out of a newbie's scope. I intend to only use the functions avaliable in VB to in making a simple game. Please guide me along. Thanks.

Can we make a Circular health meter using the tools in VB? (Like those in Diablo)

Currently the position which my game character is in, is defined by co-ordinates of X and Y.
(Example:
If X < 10 And X >5 And Y < 20 And Y>10 then
Location = "Town"
end if
)
Is there a better way of defining that area as "Town"?
Can we draw a map using VB?

Sound Level Meter
How to make a level or vu meter to monitor the sound of the mediaplayer

Sound Frquency Meter
is it possible to get the volume measure for different sound frequencies playing from a windows media player conrol, or some other way of playing a song on my project?

Graphical Volume Meter
So, i'm wondering now, how to make a graphical volume meter for my player

Progress Meter In StatusBar?
Is it possible to put a Progress Bar inside one of the Status Bar Panels in a VB form?

Baud Rate Meter
Hi ,

I'm thinking on bulding a baud rate meter for my computer,
for testing the upload/download of the net.
Doe someone has an idea how to start ?
thanks

Creating A Speedo Meter In VB
Hi, this is not exacly what i want, but it's something like it, what i need is when a user clicks on a command button......a value of a progressbar control should increase if he continue clicking on it, kind of like in Race car games the speedo meter's value increases while the player Presses in the Accelerate button.....how do i get this effect?

Wanted: VU-meter API For Line-in Or Mic
Does anyone know VU-meter api codes
for line in or mic ?

Analog Voltage Meter
I am starting a project that requires an analog volt meter.I want to connect the voltage source to the serial port and measure the voltage current in VB,and display it on the screen.
I believe that I will need to design a custom activeX control to achieve this.
Does anyone have experience with this sort of programming or know where to get information on achieving this.
Any assistance is much appreciated
Thanks.

Progress Meter (I Think That Is What Itīs Called) Help
Hello!!

I wonder if itīs possible to have a Progress meter to check
another program and show how much there is left of an installation, which that program is running.

And you canīt change the other programs code.
I can really need some help on this.

could you give me the code for the progress meter and the
code for checking of the programs progress..
Thanx

Sound Level Led Meter
Hi all,
Just hopeing someone could give me some advise on how to do a sound level led or any type of meter that dances up and down in respect to your audio being played.
thanks

regards

Tony

Copyright Đ 2005-08 www.BigResource.com, All rights reserved