Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General / December 2004



Tip: Looking for answers? Try searching our database.

Moving picture in VB6

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Garry - 30 Dec 2004 00:58 GMT
I am writing a VB6 program to record from the PC microphone.

I wanted to have a picture of an 'old fashioned' tape-recorder - tapes
turning when the user is recording.

The problem is that I have NO IDEA how to do this!!

ANy ideas apprecaited.

thanks

Garry
Mike D Sutton - 30 Dec 2004 01:36 GMT
> I am writing a VB6 program to record from the PC microphone.
>
[quoted text clipped - 4 lines]
>
> ANy ideas apprecaited.

Stick all of your images in one 'strip', then use the BitBlt() API call or PaintPicture() method to draw a frame in the Tick() event
handler of a timer control.  Here's an old post with some example code for you:
http://groups.google.co.uk/groups?selm=8pmu7u%242lt%241%40plutonium.btinternet.com
If you don't fancy this, you could look into the animation control which uses AVI files or for a very kludgey solution use an
embedded web browser control and drop in an animated .GIF or .SWF Flash animation (you didn't mention what your source animation
format is..)
Hope this helps,

   Mike

- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: Http://EDais.mvps.org/
Veign - 30 Dec 2004 01:39 GMT
You could probably find something here:
http://www.vbavi.craigmellon.co.uk/searchresult.asp?Category=File

The site also has code on how to add and use the AVI from a resource file.
I have used this method in the past and it works great...

Signature

Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--

> I am writing a VB6 program to record from the PC microphone.
>
[quoted text clipped - 8 lines]
>
> Garry
Veign - 30 Dec 2004 02:37 GMT
I added a quick sample showing how to use the AVI's

Play an AVI from a resource file:
http://www.veign.com/vrc_codeview.asp?type=app&id=103

Signature

Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--

> You could probably find something here:
> http://www.vbavi.craigmellon.co.uk/searchresult.asp?Category=File
[quoted text clipped - 14 lines]
> >
> > Garry
Galen Somerville - 30 Dec 2004 02:10 GMT
> I am writing a VB6 program to record from the PC microphone.
>
[quoted text clipped - 8 lines]
>
> Garry

Do you mean like the one shown on my web site?

http://home.surewest.net/galen/index.html

Fourth project down "DigitalRecordSystem"

It is a simple animated GIF

Galen
Larry Serflaten - 30 Dec 2004 14:22 GMT
> I am writing a VB6 program to record from the PC microphone.
> I wanted to have a picture of an 'old fashioned' tape-recorder - tapes
[quoted text clipped - 3 lines]
>
> ANy ideas apprecaited.

Here is one simple method.  It involves using a picture box as the
control to show the animation, with an Image control to hold the
images.

To see it in action, add a picturebox and timer to a new form.
Then add an Image control to the picturebox.  The picturebox
needs to contain the image control.  You'll know if you've done
right because 1, you'll be able to see the image control, and 2,
the image control will stay with the picturebox where ever you
move the picturebox to.  

With the controls set up like that, paste the code below into
the form's code window.  It was a quick job and could stand
improvement, but it may help you see how to get the job done!

HTH
LFS

Option Explicit

Private FrameCounter As Long

Private Sub Form_Load()
 BuildAnimation
 Timer1.Interval = 100
 Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
 Image1.Left = FrameCounter * -500
 FrameCounter = (FrameCounter + 1) Mod 11
End Sub

Private Sub BuildAnimation()
Dim x As Long, a As Single
 
 ' Set up
 Picture1.Move 300, 300, 6000, 400
 Picture1.AutoRedraw = True
 Picture1.BackColor = vbWhite
 Picture1.FillColor = &H808080
 Picture1.FillStyle = vbFSSolid
 
 ' Draw images
 For x = 0 To 10
   Picture1.Line (x * 500 + 90, 120)-Step(240, 180), vbBlack, B
   Picture1.Line (x * 500 + 90, 180)-Step(120, 90), vbBlack
   Picture1.Line -Step(120, -90), vbBlack
 Next
 Picture1.FillColor = &HC0C0C0
 For x = 0 To 10
   Picture1.Circle (x * 500 + 90, 120), 90, &HEEEEEE
   Picture1.Line -Step(90 * Cos(a), 90 * Sin(a)), vbRed
   Picture1.Circle (x * 500 + 330, 120), 90, &HEEEEEE
   Picture1.Line -Step(90 * Cos(a), 90 * Sin(a)), vbBlue
   a = a + 0.6
 Next
 
 ' Move images to Image control
 Image1.Picture = Picture1.Image
 Image1.Move 0, 0
 ' Set frame size
 Picture1.Move 300, 300, 510, 450
 
End Sub
Stefan Berglund - 31 Dec 2004 00:35 GMT
in <uOgJJqn7EHA.1396@tk2msftngp13.phx.gbl>

>Option Explicit
>
[quoted text clipped - 43 lines]
>  
>End Sub

Larry, I'd just like to say thank you for the countless small
quickie demos you've provided over the years.  So simple, and yet
so cool.  Thanks and have a great New Year!

---
Stefan Berglund
Larry Serflaten - 31 Dec 2004 01:41 GMT
> Larry, I'd just like to say thank you for the countless small
> quickie demos you've provided over the years.  So simple, and yet
> so cool.  Thanks and have a great New Year!

Thanks for the complement, it IS nice to get one occasionally.

This year included my induction to the Microsoft MVP crowd,
let's hope the next year gets even better!

<g>
LFS
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.