473,624 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing pictures and playing MIDI files

9 New Member
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.Pictur e 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 1599
Killer42
8,435 Recognized Expert Expert
...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
6984
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? (I'm assuming it uses MIDI.)
0
1909
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 java.sun.com/j2se/1.4.2/docs/guide/sound/programmer_guide for most of my information. Is it possible to give the sequencer near future input notes to play *while* the sequencer is already playing a previous sequence. I'm thinking about sort of an interactive sequencer where the sequence...
0
2099
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. It reads and writes midi files! It is *very* easy to write your own event handlers to make midi files do whatever you want them to. It uses the same general ideas as the Sax parser for xml.
11
2734
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 programming language), but my whole college education depends on this project. Maybe someone has simillar program or could give me some hints how to do it. best regards - borat
2
12051
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 note to play. The midi people want like 50 bucks for a reference, and as this will be a personal use type application, I can't see spending the money on it. If anyone has a nice enumerated list of the ID's for the instruments and notes/chords,...
0
1234
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 them as sound... basically i wanna make .wav songs with the midi technology. kinda like sony's ACID but REALLY simple and no need to actually save or use midi files. i've seen people send raw data to the midi synth or w/e so it plays the sound, but...
8
5614
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
2744
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 from 2003 or 2005. Some packages don't seem to be really used, for instance portmidi doesn't even support installing it system-wide; you can compile it and... no make install for you. What I've found so far: -...
6
4927
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 field is welcome. Thanks in advance.
0
8249
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8685
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8348
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1493
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.