473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Changing pictures and playing MIDI files

Newbie to VB6, comfortable with HTML, MS Access so I ain't totally stupid. Maybe just dumb.

Am writing a Biblical Quiz program where I need to change a picture and midi sound file each time a user advances to a new question.

Have played with several routines but none seem to do what I want.

The following will show the first picture, on click shows the second picture, on the next click shows the third picture. Each click thereafter just rotates between pics 2 and 3. I have 9 pictures that need to be rotated or randomly sellected on each NEXT Question sellection.

This structure should do, but can not figure out how to change Picture2.Picture with either rotating or random method.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.  
  3. 'Description: Displays a two frame animation using a timer
  4. 'Place code in timer and set interval as needed
  5.  
  6. Static Choice As Integer
  7. 'Uses 3 picture boxes.
  8. 'Picture1 - visible display   Picture2&3 - pictures
  9. If Choice Then
  10.     Picture1.Picture = Picture2.Picture
  11. Else
  12.     Picture1.Picture = Picture3.Picture
  13. End If
  14.  
  15. Choice = Not Choice
  16.  
  17. End Sub
Next stupid question - What does the "." do in a command ?

Also any URL's for good "Dummy - Dummy's for VB6"

At least I did get one function to work correctly, I have an animated dove that was too lazy to flap his wing when flying across the screen. Of course VB6 doesn't see animated GIF's, so got this one figured out by extracting the 15 individual GIF pictures and using the following routine he does fly across as I want him to do.

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. Private Sub Timer3_Timer()
  4.     picAnimate.Top = 1 'set location from top of screen
  5.  
  6. 'Static variables keep there value with each procedure call
  7.  Static currentpic As Integer
  8.  
  9.     'Determines if the animation is at the last picture and starts
  10.     'at the beginning if so
  11.     If currentpic = 14 Then currentpic = -1
  12.  
  13.     'moves to the next picture
  14.     currentpic = currentpic + 1
  15.  
  16.     'moves the picture to the left
  17.     picAnimate.Left = picAnimate.Left + 55 'orig setting 400
  18.  
  19.     'determines if image is off screen
  20.     '-3600's causes a slight delay in the animation coming back around
  21.     If (picAnimate.Left) > ScaleWidth Then picAnimate.Left = -1000 ' orig -3600
  22.  
  23.     'changes the image to the new image
  24.     picAnimate.Picture = imgDove(currentpic).Picture
  25.  
  26. End Sub
Thanks for any assistance.
Nov 23 '07 #1
1 1589
Killer42
8,435 Expert 8TB
...I have 9 pictures that need to be rotated or randomly sellected on each NEXT Question sellection.
Put the images into a control array of Image or Picturebox controls. Then use a random number as the index to pick them up from the array.

Next stupid question - What does the "." do in a command ?
Can you explain what you mean by that question?

You will encounter a lot of dots being used as delimiters between parts of a property or variable name. For example, Textbox1.Text refers to the Textbox1 control, Text property.[/quote]

Also any URL's for good "Dummy - Dummy's for VB6"
No idea.


At least I did get one function to work correctly, I have an animated dove that was too lazy to flap his wing when flying across the screen.
Yo umight check out the animation control, to see whether it's appropriate for your situation. I think you would need to convert the animation to AVI format, though.

And of course there are ways to get VB to display an animated GIF, though I can't remember them right now.
Nov 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: SOB-like MIDIs | last post by:
The applet for endlessly rising/falling scale (auditory illusion) on this page is fantastic! http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/ST/st.html How is this done?...
0
by: Put 030516 in email subj to get thru | last post by:
I'm trying to learn about Java MIDI programming. Specifically, I'm interested in playing with Java MIDI sequencers (all puns intended). I'm looking at...
0
by: Max M | last post by:
If anybody is interrested in Midi, but are not on the Python Midi list, I will just notify that I have released the first version of a high level midi package for Python. It is fully functional....
11
by: Kuba Araszkiewicz | last post by:
Hello! I have to write a program, which would convert midi files to notes, notes to midi files and which would make one MIDI file from two different. I'm totally lame in C (and any other...
2
by: coderx | last post by:
I am attempting to build a piece of software which will replicate a guitar's notes. The major problem I have is sending the message to the midi output device which has the correct instrument and...
0
by: Sonicfreak17 | last post by:
OK... ive been EVERYWHERE online to find a way to do this: i want to be able to make .wav files with midi data- not so much premade midi files- but just sending on the fly midi notes and recording...
8
by: ravi | last post by:
Can anybody tell me you to play MIDI file through a C program ? i am using Turbo C++ Thanks.........
6
by: =?ISO-8859-2?Q?Maciej_Blizi=F1ski?= | last post by:
For the last couple of days, I've been looking for a Python midi library. I'm generally interested in sending MIDI events via ALSA. It seems like everything out there is pretty old; packages are...
6
by: Massi | last post by:
Hi everyone, I'm searching for "something" which allows me to write scripts which handle midi files. I'm totally a newbie in audio manipulation, therefore any suggestion or link related to this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.