+ All Categories
Home > Documents > Color Mixer Machine

Color Mixer Machine

Date post: 13-Apr-2015
Category:
Upload: mohamad-saad
View: 109 times
Download: 9 times
Share this document with a friend
Description:
visual basicbasic stamp
79
1 1. Abstract Mixing process is a part of production mechanism in many painting industries. When mixing of different materials in large quantities is done manually, the time is consumed to attain our goal. Particularly in painting industries we have to generate thousands of colors with the combination of a few colors. To get accurate and a desired color combination I thought of doing project related to that. The design and fabrication of a small size mixer will acquires these advantages. I have designed and developed a system performed this operation successfully with the help of the microcontroller unit. The paint mixer machine system consists of a microcontroller, relays, transistors, solenoid valves, and pipe lines. Three tanks for red, yellow and blue pigments whose output is controlled by a microcontroller unit. Graphical user interface (GUI) using visual basic is developed make the whole operation easy and accurate and this software is capable of scanning the result and make self-correction for the output pigment. The microcontroller sends the signal to the relay driver circuits. This in turn enables the relays which are connected to the solenoid valves. The solenoid valves operate the pipe line 1, 2 and 3. This in turn delivers the required amount of paints to the mixture tank to reach the target. Thus accurate color of the mixture in particular proportion is obtained through this mechanism.
Transcript
Page 1: Color Mixer Machine

1

1. Abstract

Mixing process is a part of production mechanism in many painting

industries. When mixing of different materials in large quantities is

done manually, the time is consumed to attain our goal. Particularly in

painting industries we have to generate thousands of colors with the

combination of a few colors. To get accurate and a desired color

combination I thought of doing project related to that. The design and

fabrication of a small size mixer will acquires these advantages. I

have designed and developed a system performed this operation

successfully with the help of the microcontroller unit.

The paint mixer machine system consists of a microcontroller, relays,

transistors, solenoid valves, and pipe lines. Three tanks for red,

yellow and blue pigments whose output is controlled by a

microcontroller unit.

Graphical user interface (GUI) using visual basic is developed make

the whole operation easy and accurate and this software is capable

of scanning the result and make self-correction for the output

pigment.

The microcontroller sends the signal to the relay driver circuits. This

in turn enables the relays which are connected to the solenoid valves.

The solenoid valves operate the pipe line 1, 2 and 3. This in turn

delivers the required amount of paints to the mixture tank to reach the

target. Thus accurate color of the mixture in particular proportion is

obtained through this mechanism.

Page 2: Color Mixer Machine

2

2. Introduction

Color has been investigated and used for more than 2000 years.

Throughout history. Many different civilizations have experimented,

have learned and have used colors. We are still learning today about

how color affects us and its importance in our lives.

2.1 Earliest Times of Color

The ancient Egyptians have been recorded to have been using

color for cures and ailments. They worshipped the sun, knowing

that without light there can be no life. They looked at nature and

copied it in many aspects of their lives. The floors of their

temples were often green - as the grass which then grew

alongside their river, the Nile. Blue was a very important color

to the Egyptians too; the color of the sky. They built temples for

healing and used gems (crystals) through which the sunlight

shone. They would have different rooms for different colors. We

could perhaps relate our present methods of color/light therapy

to this ancient practice.

Figure 1.2: Ancient Egyptians used color for therapy

Page 3: Color Mixer Machine

3

There are lists on papyrus dating back to 1550 BC of color

"cures".

Their deep knowledge and understanding of the healing powers

of the color rays was so nearly lost when, later on in history, the

Greeks considered color only as a science. Hippocrates,

amongst others, abandoned the metaphysical side of color,

concentrating only on the scientific aspect. Fortunately, despite

this, the knowledge and philosophy of color was handed down

through the ages by a few.

The Chinese also apparently practiced Color Healing. The

Nei/ching, 2000 years old, records color diagnoses.

2.2 Early Color Studies

Some of the early studies and theories

about light were done by Aristotle. He

discovered that by mixing two colors, a third

is produced. He did this with a yellow and

blue piece of glass, which when brought

together produced green. He also

discovered that light travels in waves.

Page 4: Color Mixer Machine

4

2.3 Issac Newton (1642 - 1727)

A pioneer in the field of color, Isaac Newton

in 1672, published his first, controversial

paper on color, and forty years later, his

work 'Optics'.

Newton passed a beam of sunlight

through a prism. When the light came out of the prism is

was not white but was of seven different colors: Red,

Orange, Yellow, Green, Blue, Indigo and Violet. The

spreading into rays was called dispersion by Newton and

he called the different colored rays the spectrum.

He learnt that when the light rays were passed again

through a prism the rays turned back into white light. If

only one ray was passed through the prism it would come

out the same color as it went in. Newton concluded that

white light was made up of seven different colored rays.

2.4 Modern Days

We are lucky that now we are all able to choose any color we

like and can buy products of any color freely. This was not

always the case. In times gone by, the pigments used to dye

fabrics violet/purple were very expensive and, therefore, only

available to the wealthy. For example, the Romans in high

office would wear purple robes since this, to them, indicated

power, nobility and thus authority.

Page 5: Color Mixer Machine

5

2.5 The future of Color

We are now using color in very positive

ways again. Businesses are accepting that

their employees may work better given a

certain environment and hospitals and

prisons are also becoming aware of the

effect that the color around them can have

on patients and prisoners respectively. Paint companies have

introduced new color cards with the therapeutic aspects of color

in mind. Cosmetic companies too have 'color therapy' ranges

included in their products. Color has a great deal to offer us and

can be found all around us in nature.

We need to expand our awareness of color so that we can truly

benefit from nature's gifts so that 'color' becomes a way of life,

not just a therapy.

3. Additive primary colors

Additive colors are colors that are associated with emitted light

directly from a source before an object reflects the light. These colors

are red, green and blue. These are the colors we are probably most

familiar with in association with television, and computer displays.

Page 6: Color Mixer Machine

6

The additive color theory was first described by James Clark Maxwell

in the mid-1800s.

When equal amounts of Red

Green and Blue light are

combined, they produce white

light. By adding the colors

together to produce white, we call

these additive colors.

4. Color Properties

Each color has its own properties with its own wavelength and

frequency. Although white could be said to be a color, it is generally

not included in the scientific spectrum as it is in fact made up of all

the colors of the spectrum, but it is often referred to being a color.

Isaac Newton proved that white light is indeed made up of colors by

passing natural sunlight through a glass prism which in result

projected a rainbow of colors on a surface. He then proceeded to

use a second glass prism and combined the light from the first prism

(which split the suns rays into sperate colors) to produce white light

once again. Thus proving white light (i.e. the sun) contains color.

The tables below show each color and its relative property.

Frequency = Terahertz (one trillion cycles per second)

Wavelength = Nanometers (One meter equals 1,000,000,000 nanometers).

Page 7: Color Mixer Machine

7

Violet

Wavelength 425 - 400 nm

Frequency 700 - 790 thz

Complementary color Yellow

Indigo

Wavelength 450 - 425 nm

Frequency 670 - 700 thz

Complementary color Orange

Blue

Wavelength 500 - 450 nm

Frequency 670 - 600 thz

Complementary color Red

Green

Wavelength 570 - 500 nm

Frequency 580 - 530 thz

Complementary color Red

Page 8: Color Mixer Machine

8

Yellow

Wavelength 590 - 570 nm

Frequency 530 - 510 thz

Complementary color Violet

Orange

Wavelength 610 - 590 nm

Frequency 510 - 480 thz

Complementary color Indigo

Red

Wavelength 750 - 610 nm

Frequency 480 - 405 thz

Complementary color Blue

5. Complementary Colors

When placed next to each other, complementary colors tend to

look balanced and are colors opposite to each other on the color

wheel also, when placed next to each other they appear to

Page 9: Color Mixer Machine

9

become brighter. They are also used together in Color Therapy to

give balance. We need the balance of the electric/cool colors and

the magnetic/warm colors for our wellbeing and smooth

functioning of our bodies. Complementary colors are opposite

each other on the color wheel,

Color Complementary Color

Violet

Yellow

Indigo

Orange

Blue

Red

Green Magenta

Page 10: Color Mixer Machine

10

Yellow

Violet

Orange

Indigo

Red

Blue

Magenta

Green

Page 11: Color Mixer Machine

11

Magenta is the eighth color and is not part of the visible spectrum,

but is a combination of red and violet, thus combining the energies

of those two colors. That is to say, that magenta helps us to use

our earthly experience and grounding together with intense

spiritual awareness. It can help to release past conditioning and

help us to move forward.

6. How we see Color

The way in which most of us actually see color, is through the

sensors in the retina of our eyes called rods and cones. The rods

are sensitive to low light and the cones, which require a greater

intensity of light, are sensitive to color. The message is passed to

the optic nerve and then on to the brain. We see color because of

the Rods and Cones in our eyes. There are about 120 million rods

and about 6 to 7 million cones, in the human eye. Rods are more

sensitive than the cones but they are not sensitive to color, they

perceive images as black, white and different shades of grey.

More than one thousand times as sensitive, the rods respond

better to blue but very little to red light. Each cone contains one of

three pigments sensitive to either RED GREEN or BLUE. Each

pigment absorbs a particular wavelength of color. There are short

wavelength cones that absorb blue light, middle wavelength cones

Page 12: Color Mixer Machine

12

that absorb green light, and long wavelength cones that absorb

red light.

Figure 6.1: The eye picks up color and light by the Rods and Cones in the eye. It is the

Cones that detect Color. Each cone contains one of three pigments sensitive to either RED

GREEN or BLUE.

When we observe a color that has a wavelength between that of

the primary colors red, green and blue, combinations of the cones

are stimulated. An example could be that yellow light stimulates

cones that are sensitive to red and to green light. The result is that

we can detect light of all colors in the visible spectrum.

People who suffer color blindness have less numbers of particular

cones than normal, so they get colors confused. If we lose our eye

sight, the body adapts and receives color rays through the skin. It

takes time for the body to adapt, but it has been shown that

people, who are blind, can differentiate between different colors.

Page 13: Color Mixer Machine

13

7. Colors and Frequencies

The diagram shows the seven rainbow colors in order of their

frequency. Violet is at the top of the column since it has the

shortest wavelength and the highest frequency. Red at the base

with the longest wavelength and lowest frequency.

All seven colors of the spectrum can be seen by passing light

through a prism. The three 'higher' colors of - Violet, Indigo and

Blue are in Color Therapy Terms called the cool / electric colors

and generally indicate calm/and coolness.

The three ' lower ' colors of Yellow, Orange and Red are in Color

Therapy Terms called the warm / magnetic colors and generally

these are warming and activating colors. The color Green is the

balance between the cool and warm rays.

Page 14: Color Mixer Machine

14

8. Primary colors

Contrary to popular belief, there are actually two types of primary

colors. Additive primary colors and Subtractive primary colors are

the only two basic methods to produce color. To create all the

colors of the rainbow, both processes use primary colors, which

are colors that cannot be created by mixing other colors.

8.1 Additive Primary Colors

The Additive Primary colors are

Red, Green and Blue. Additive

colors are colors that are

associated with emitted light

directly from a source before an

object reflects the light. These

colors are red, green and blue -

(often seen for short as RGB). These are the colors we are

probably most familiar with in association with television, and

computer displays. If all three of the additive colors were

combined together in the form of light, they would produce

white.

Some examples where additive primary colors are used:

1. television

2. theatrical lighting

3. computer monitors

Page 15: Color Mixer Machine

15

8.2 Subtractive Primary

Colors

Subtractive colors are colors

that are associated with

reflected light. In this case the

subtractive colors are blue red

and yellow. These are the colors we are probably most familiar

with the as the primary colors from school. These colors are

associated with the subtraction of light and used in pigments

for making paints, inks, colored fabrics, and general colored

coatings that we see and use every day. If all three of the

subtractive primary colors were combined together, they would

produce black.

8.3 Subtractive primary colors differ in the printing

process

All printing processes use

subtractive colors in the form of

Cyan (blue) Magenta (red)

Yellow and sometimes Black.

This is known as CMYK for

short (cyan, magenta, yellow,

black) the 'K' stands for black

Page 16: Color Mixer Machine

16

in the printing process.

These colors: Cyan, Magenta and Yellow are a set of

subtractive primaries and are most commonly used by printers.

They are commonly referred to as the 'printing primaries'.

It is difficult to achieve a good black from just these color

pigments so printers will sometimes also use black. The reason

that printers use this set of primaries as opposed to the painting

primaries of Blue, red and Yellow, is that they yield far better

results. If you are using these colors for painting however, you

will find that mixing them is far less intuitive than when mixing

the painting primaries.

Some examples where subtractive primary colors are used:

Textiles

Clothes

Furnishings

Printing

Paints

Colored coatings

8.4 Tertiary colors

Page 17: Color Mixer Machine

17

Tertiary colors are combinations of primary and secondary

colors. There are six tertiary colors; red-orange, yellow-

orange, yellow-green, blue-green, blue-violet, and red-violet.

An easy way to remember these names is to place the

primary name before the other color. So the tertiary color

produced when mixing the primary color blue with the

secondary color green, is called 'blue-green'.

9. Colors In Our Lives

9.1 Colors in decoration

When decorating an area - the complementary colors, and

their variations, should be remembered and combined with

our main choice of color by way of soft furnishings perhaps,

pictures etc.

Page 18: Color Mixer Machine

18

It is also helpful to take in to account the aspect of a room.

For example, should you require a calming atmosphere in a

north facing room, which may well be one of the colder

rooms in your house, remember to use some warm colors

(i.e. variations of the warm colors of yellow, orange and red)

to avoid the room feeling colder.

9.1.1 Using Colors in the home

When using color in the home environment, we all have our

own personal choice. Particular color choice though can help

towards providing a specific 'feeling' for a space. Below we

have put together some suggested uses of color in the

home, workplace and other various environments, and the

effects these colors can produce.

Violet

Effects of Violet

as a color

Calming for body

and mind.

Good for

meditation and

prayer.

Enhances

purpose and

Suggested Areas

of Use for the

color Violet

Places of worship.

Entry areas to

clinics and

hospitals.

Festival areas.

Pale violet in

Page 19: Color Mixer Machine

19

dignity.

Heightens our

awareness and

helps us to give

of our very best.

Purifying.

bedrooms.

Indigo

Effects

Sedative.

Helps to open up

our intuition.

The color of

divine. knowledge

and the higher

mind.

Suggested Areas

of Use

Not suitable for

areas for

entertainment but

for more 'quiet'

places.

Bedrooms.

Treatment rooms.

Some people find

indigo is helpful for

studying so this

color could be

used as part of the

decor of a library

or study.

Page 20: Color Mixer Machine

20

Blue

Effects

Calming, relaxing

and healing.

Not as sedating

as indigo. Also

the color of

communication.

Suggested Areas

of Use

Any rooms except

those used for

physical activity or

play.

Green

Effects

Balancing,

harmonizing and

encourages

tolerance and

understanding.

Suggested Areas

of Use

Depending upon

the shade, can be

used for most

areas.

Use with other

colors/color as well

to avoid the

balance and

harmony

becoming more

like total inactivity

and indecision.

Page 21: Color Mixer Machine

21

Yellow

Effects

Stimulates mental

activity.

Promotes feeling

of confidence.

Helpful for study

as it helps us to

stay alert.

Suggested Areas

of Use

Activity rooms.

Entrance halls.

Not for bedrooms

as yellow can

interfere with sleep

since it tends to

keep our minds

"switched on"

Not ideal for areas

of possible stress.

Orange

Effects

Warming and

energizing.

Can stimulate

creativity.

Orange is the

color of fun and

sociability.

Suggested Areas

of Use

Any activity area

and creative

areas.

Not ideal for

bedrooms or areas

of possible stress.

Page 22: Color Mixer Machine

22

Red

Effects

Energizing,

exciting the

emotions.

Stimulates

appetite.

Suggested Areas

of Use

Any activity area

but red needs

careful choice of

tone and depth

and the space in

which it is to be

used as it can

make a space look

smaller and can be

claustrophobic or

oppressive.

However, used

well, red and its

variations can

make a space feel

warm and cosy.

Often used in

restaurants.

9.1.2 Color and Business

It is widely known that color has a very real effect on people

The right or wrong choice of colors can make a big

Page 23: Color Mixer Machine

23

difference to the success of your business and the message

you convey to your prospective clients/customers.

Logos

Headed notepaper

Advertising material

Staff uniform

Office décor.

10. Mixing colors

Primary colors are the first colors you

need in order to mix a variety of other

colors. Knowing your primary colors is

the first step to achieving proper color

mixing.

First, let's take a look at what happens when we overlap the

three primary colors of pigment. We can mix "equal" parts of

any two of these primary colors to produce an opposite result.

Because pigments reflect and absorb light, their resulting

mixtures are not as pure as light. Some pigments tend to be

more intense than others, so an "equal" mixture is relative to

the intensity of the pigment. This is

We have our three primary colors. How can we produce so

many other colors from just these three? Actually color is quite

mathematical. Just as you can add 1 and 1 to make 2, or 0.5

and 0.5 to make 1, you can mix colors in a similar manner. Let's

Page 24: Color Mixer Machine

24

start with yellow and red. If you mix these two colors together,

you produce orange "in-between colors".

10.1 Creating Tones

"Breaking colors" across the wheel, or creating tones, is

achieved by mixing varying amounts of colors that are

opposite each other on the color wheel. For instance, if

you mix equal parts of red and cyan (opposite colors or

complements), the result will be a dark grayish-black

color. (Opposite colors neutralize each other.) If you mix a

small part of cyan to red, the result will be a red-brown

color. If you mix more cyan, the result will be a bit grayer,

etc. When creating tones, you are actually lowering the

saturation, or intensity, of the original pure colors.

10.2 Creating Tints

When you add white to a color, you are creating a tint of

that color. The more white you add, the lighter the color

becomes.

Page 25: Color Mixer Machine

25

10.3 Creating Shades

When you add black to a color, you are creating a shade

of that color. The more black you add, the deeper the

color becomes.

10. Project Components

10.1 Body

Machine body made from wood which have:

10.1.1 Elastic Properties: wood is usually assumed to

behave as an elastic material for most engineering

applications.

10.1.2 Strength Properties: When a compression load is

applied perpendicular to grain, it produces stress that

deforms the wood cells perpendicular to their length.

Once the hollow cell cavities are collapsed wood is quite

strong.

10.1.3 Energy Absorption Resistance: Wood is often a

preferred material for shock loading.

10.1.4 Hardness: Hardness represents the resistance of

wood to indentation and marring.

Page 26: Color Mixer Machine

26

Figure 10.1: Machine body

10.2 Electromechanical Components

10.2.1 Solenoid Valves

The valve shown in the picture is a normally-closed,

direct-acting (i.e. Two Way, two ports) valve. This type of

solenoid valve has the most simple and easy to handle.

Figure10.2: ¼ inch 24 VAC solenoid valve

Page 27: Color Mixer Machine

27

1. Valve Body

2. Inlet Port

3. Outlet Port

4. Coil / Solenoid

5. Coil Windings

6. Lead Wires

7. Plunger

8. Spring

9. Orifice

The media controlled by the solenoid valve enters the valve

through the inlet port (Part 2 in the illustration above). The

media must flow through the orifice (9) before continuing into

the outlet port (3). The orifice is closed and opened by the

plunger (7). The valve pictured above is a normally-closed

solenoid valve. Normally-closed valves use a spring (8) which

presses the plunger tip against the opening of the orifice. The

sealing material at the tip of the plunger keeps the media from

entering the orifice, until the plunger is lifted up by an

electromagnetic field created by the coil.

10.2.2 Relays

Page 28: Color Mixer Machine

28

Figure 10.4: Single pole 6V relay

10.3 Electronic Component

10.3.1 Microcontroller: Basic Stamp II

Figure 10.5: Basic Stamp II module

The BASIC Stamp is a microcontroller developed by

Parallax, Inc uses a PIC16C57 Microchip

Technology Inc. which is easily programmed using

a form of the BASIC programming language. It is

called a “Stamp” simply because it is close to the

size of an average postage stamp. The Stamp runs

on 5 to 15 volts DC. All Stamps feature an on-board

5-volt regulator which will convert an input 6 to 15

volts (on the VIN pin) down to the 5 volts that its

components require. The BS2-IC consumes 8 mA in

running mode and 100 μA in sleep mode, not

including any circuitry on the I/O pins.

Items needed for programming and using Basic

Stamp are:

Page 29: Color Mixer Machine

29

1. The BASIC Stamp Windows Editor programming

software.

2. The programming cable.

3. The BASIC Stamp User's Manual.

4. The BASIC Stamp module itself.

Features:

Processor Speed: 20 MHz

Program Execution Speed: ~4,000 PBASIC

instructions/sec.

RAM Size: 32 Bytes (6 I/0, 26 Variable)

EEPROM (Program) Size: 2 KB; ~500 PBASIC

instructions

Number of I/O Pins: 16 + 2 dedicated serial

Current Draw @ 5 VDC: 3mA Run, 50 μA Sleep

Source/Sink Current per I/O: 20 mA / 25 mA

Source/Sink Current per unit: 40 mA / 50 mA per 8 I/O

pins

PBASIC Commands: 42

Package: 24-pin DIP

Industrial-Rated since Rev J

Page 30: Color Mixer Machine

30

10.3.2 Parallax USB to Serial (RS-232)

Figure 10.6: Parallax USB to Serial

Parallax has designed a USB to Serial (RS-232) adapter that is

compact and economical to provide a Virtual Com Port for all of its

products that have a (9-pin) serial connector.

Features:

USB Version 1.1 and 2.0 compatible

Connects to your computer with a USB A to Mini-B

cable (included)

DB9 male socket to connect to your board's serial

programming and debugging port

FTDI Drivers for most Windows PC operating

systems are included with Parallax programming

environment software

Drivers for different operating systems are available

from FTDI chip (see Downloads below)

Page 31: Color Mixer Machine

31

Easy to Use:

Install one of these Parallax programming

environments (BASIC Stamp Editor, Propeller Tool,

SX-Key IDE).

Or, download the USB drivers separately from the

links below

Connect the USB to Serial Adapter to your PC with

a USB A to Mini B cable

A message from your system tray will say your

hardware is installed and ready to use (Windows)

Connect the adapter to your device's DB9

connector

Key Specifications:

Power requirements: Regulated 5 V from USB port

or powered hub.

Communication: Full speed USB, full duplex serial

from 300 baud to 3 M-baud.

Dimensions: 1.7 x 1.2 x 0.5 in (51 x 16 x 12 mm)

Operating temp range: +32 to +158 °F (0 to +70 °C)

Page 32: Color Mixer Machine

32

10.3.3 Web Cam

Figure 10.7:

Brief Specification

Resolution: 1/6 CMOS, 640×480 pixels.

Still image: Up to 16 Megapixel, 4608x3456.

Frame rate: 30fps@160x120, @320x240,

@640x480.

Lens: F=2.4, f=3.5 mm.

Viewing angle: 54 degrees.

Focus range: Automatic focus, 10 cm to infinity.

White balance: Automatic.

Exposure control: Automatic.

Microphone: Built-in.

Interface: USB 2.0.

System Requirements

PC with Pentium 800 MHz or above.

256 MB RAM or above.

At least 165 MB of free hard disk space.

Page 33: Color Mixer Machine

33

Windows XP, Vista, Windows 7, Mac OS X v10.4.8 and above.

11. Software

11.1 Visual Basic GUI

Graphical User Interface Developed using Visual Basic

2010. This GUI enable machine operator to select any

color by two different methods:

1. By picking it from listed colors.

2. Entering the ratios specified.

Page 34: Color Mixer Machine

34

11.2 Feedback

Feedback provided by web cam with RGB function which

analyze the output color and return its Red, Green and Blue

values then this values compared to the inputted values to

insure that the result is correct and if there is any variation the

program will automatically make corrections.

Page 35: Color Mixer Machine

35

Page 36: Color Mixer Machine

36

12. References

http://www.colourtherapyhealing.com/colour/colour_histor

y.php

http://msdn.microsoft.com/en-us/vstudio/hh388568.aspx

http://www.boondog.com/tutorials/dlltutor/dlltutor.htm

http://sketchup.google.com/download/

http://www.parallax.com/

http://en.wikipedia.org/wiki/Solenoid_valve

http://www.driverdownloading.info/drivers/Webcam_Driver

/A4_Tech_Webcam_Drivers.html

http://www.microsoft.com/visualstudio/en-

us/products/2010-editions/visual-basic-express

http://www.irfanview.net/faq.htm

Page 37: Color Mixer Machine

37

13. Appendix I

Visual Basic Code

Imports System.Runtime.InteropServices Public Class Form1 Inherits System.Windows.Forms.Form Private WithEvents serialP As New IO.Ports.SerialPort Dim R, G, B As Long Dim rly As String Dim x As Integer = 1 Dim y As Integer = 1 Dim z As Integer = 1 Dim i As Integer = 1 Dim a, b, c As Integer Dim data As IDataObject Dim bmap As Image Friend WithEvents RectangleShape3 As Microsoft.VisualBasic.PowerPacks.RectangleShape Friend WithEvents Button3 As System.Windows.Forms.Button Friend WithEvents Button4 As System.Windows.Forms.Button Friend WithEvents Label16 As System.Windows.Forms.Label Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox Friend WithEvents lstDevices As System.Windows.Forms.ListBox Friend WithEvents lblDevice As System.Windows.Forms.Label Friend WithEvents ProgressBar4 As System.Windows.Forms.ProgressBar Friend WithEvents ProgressBar5 As System.Windows.Forms.ProgressBar Friend WithEvents ProgressBar7 As System.Windows.Forms.ProgressBar Friend WithEvents ProgressBar9 As System.Windows.Forms.ProgressBar Friend WithEvents ProgressBar6 As System.Windows.Forms.ProgressBar Friend WithEvents ProgressBar8 As System.Windows.Forms.ProgressBar Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents Label8 As System.Windows.Forms.Label Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents Label13 As System.Windows.Forms.Label Friend WithEvents Label14 As System.Windows.Forms.Label Friend WithEvents Label15 As System.Windows.Forms.Label Friend WithEvents ShapeContainer1 As Microsoft.VisualBasic.PowerPacks.ShapeContainer Friend WithEvents RectangleShape1 As Microsoft.VisualBasic.PowerPacks.RectangleShape

Page 38: Color Mixer Machine

38

Friend WithEvents TrackBar1 As System.Windows.Forms.TrackBar Friend WithEvents TrackBar2 As System.Windows.Forms.TrackBar Friend WithEvents TrackBar3 As System.Windows.Forms.TrackBar Friend WithEvents Label10 As System.Windows.Forms.Label Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents Label12 As System.Windows.Forms.Label Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents ShapeContainer2 As Microsoft.VisualBasic.PowerPacks.ShapeContainer Friend WithEvents RectangleShape2 As Microsoft.VisualBasic.PowerPacks.RectangleShape Friend WithEvents picCapture As System.Windows.Forms.PictureBox Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar Friend WithEvents ProgressBar2 As System.Windows.Forms.ProgressBar Friend WithEvents ProgressBar3 As System.Windows.Forms.ProgressBar Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents btnStart As System.Windows.Forms.Button Friend WithEvents btnStop As System.Windows.Forms.Button Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents Button6 As System.Windows.Forms.Button Friend WithEvents Label19 As System.Windows.Forms.Label Friend WithEvents Label18 As System.Windows.Forms.Label Friend WithEvents Label17 As System.Windows.Forms.Label Friend WithEvents RYB1 As System.Windows.Forms.Timer Friend WithEvents Button16 As System.Windows.Forms.Button Friend WithEvents RYB2 As System.Windows.Forms.Timer Friend WithEvents Button17 As System.Windows.Forms.Button Friend WithEvents RY1 As System.Windows.Forms.Timer Friend WithEvents Button18 As System.Windows.Forms.Button Friend WithEvents YB1 As System.Windows.Forms.Timer Friend WithEvents Button19 As System.Windows.Forms.Button Friend WithEvents RB1 As System.Windows.Forms.Timer Friend WithEvents Finish As System.Windows.Forms.Timer Friend WithEvents Magenta As System.Windows.Forms.Button Friend WithEvents Yellow As System.Windows.Forms.Button Friend WithEvents Red As System.Windows.Forms.Button Friend WithEvents Olive As System.Windows.Forms.Button Friend WithEvents Green As System.Windows.Forms.Button Friend WithEvents YellowGreen As System.Windows.Forms.Button Friend WithEvents Orange As System.Windows.Forms.Button Friend WithEvents OrangeRed As System.Windows.Forms.Button Friend WithEvents BluePurple As System.Windows.Forms.Button Friend WithEvents GreenBlue As System.Windows.Forms.Button Friend WithEvents Purple As System.Windows.Forms.Button Friend WithEvents CadetBlue As System.Windows.Forms.Button

Page 39: Color Mixer Machine

39

Friend WithEvents Yell As System.Windows.Forms.Timer Friend WithEvents Blu As System.Windows.Forms.Timer Friend WithEvents Button8 As System.Windows.Forms.Button Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox Friend WithEvents ShapeContainer3 As Microsoft.VisualBasic.PowerPacks.ShapeContainer Friend WithEvents Button5 As System.Windows.Forms.Button Friend WithEvents Analyse As System.Windows.Forms.Timer Friend WithEvents Button10 As System.Windows.Forms.Button #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents sfdImage As System.Windows.Forms.SaveFileDialog <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.sfdImage = New System.Windows.Forms.SaveFileDialog() Me.RectangleShape3 = New Microsoft.VisualBasic.PowerPacks.RectangleShape() Me.Label16 = New System.Windows.Forms.Label() Me.GroupBox4 = New System.Windows.Forms.GroupBox() Me.Button4 = New System.Windows.Forms.Button() Me.Button3 = New System.Windows.Forms.Button() Me.lstDevices = New System.Windows.Forms.ListBox() Me.lblDevice = New System.Windows.Forms.Label() Me.ProgressBar4 = New System.Windows.Forms.ProgressBar() Me.ProgressBar5 = New System.Windows.Forms.ProgressBar()

Page 40: Color Mixer Machine

40

Me.ProgressBar7 = New System.Windows.Forms.ProgressBar() Me.ProgressBar9 = New System.Windows.Forms.ProgressBar() Me.ProgressBar6 = New System.Windows.Forms.ProgressBar() Me.ProgressBar8 = New System.Windows.Forms.ProgressBar() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.Label7 = New System.Windows.Forms.Label() Me.Label8 = New System.Windows.Forms.Label() Me.Label9 = New System.Windows.Forms.Label() Me.GroupBox2 = New System.Windows.Forms.GroupBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.ShapeContainer3 = New Microsoft.VisualBasic.PowerPacks.ShapeContainer() Me.Label13 = New System.Windows.Forms.Label() Me.Label14 = New System.Windows.Forms.Label() Me.Label15 = New System.Windows.Forms.Label() Me.ShapeContainer1 = New Microsoft.VisualBasic.PowerPacks.ShapeContainer() Me.RectangleShape1 = New Microsoft.VisualBasic.PowerPacks.RectangleShape() Me.TrackBar1 = New System.Windows.Forms.TrackBar() Me.TrackBar2 = New System.Windows.Forms.TrackBar() Me.TrackBar3 = New System.Windows.Forms.TrackBar() Me.Label10 = New System.Windows.Forms.Label() Me.Label11 = New System.Windows.Forms.Label() Me.Label12 = New System.Windows.Forms.Label() Me.GroupBox3 = New System.Windows.Forms.GroupBox() Me.Button6 = New System.Windows.Forms.Button() Me.Button18 = New System.Windows.Forms.Button() Me.Button19 = New System.Windows.Forms.Button() Me.Button17 = New System.Windows.Forms.Button() Me.Button16 = New System.Windows.Forms.Button() Me.PictureBox2 = New System.Windows.Forms.PictureBox() Me.ShapeContainer2 = New Microsoft.VisualBasic.PowerPacks.ShapeContainer() Me.RectangleShape2 = New Microsoft.VisualBasic.PowerPacks.RectangleShape() Me.ProgressBar1 = New System.Windows.Forms.ProgressBar() Me.ProgressBar2 = New System.Windows.Forms.ProgressBar() Me.ProgressBar3 = New System.Windows.Forms.ProgressBar() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.btnStart = New System.Windows.Forms.Button() Me.btnStop = New System.Windows.Forms.Button() Me.Button1 = New System.Windows.Forms.Button() Me.Button2 = New System.Windows.Forms.Button() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.Button5 = New System.Windows.Forms.Button() Me.Label19 = New System.Windows.Forms.Label() Me.Label18 = New System.Windows.Forms.Label() Me.Label17 = New System.Windows.Forms.Label() Me.picCapture = New System.Windows.Forms.PictureBox() Me.Olive = New System.Windows.Forms.Button() Me.Magenta = New System.Windows.Forms.Button()

Page 41: Color Mixer Machine

41

Me.Purple = New System.Windows.Forms.Button() Me.RYB1 = New System.Windows.Forms.Timer(Me.components) Me.RYB2 = New System.Windows.Forms.Timer(Me.components) Me.RY1 = New System.Windows.Forms.Timer(Me.components) Me.YB1 = New System.Windows.Forms.Timer(Me.components) Me.RB1 = New System.Windows.Forms.Timer(Me.components) Me.Finish = New System.Windows.Forms.Timer(Me.components) Me.Yellow = New System.Windows.Forms.Button() Me.Red = New System.Windows.Forms.Button() Me.Green = New System.Windows.Forms.Button() Me.YellowGreen = New System.Windows.Forms.Button() Me.Orange = New System.Windows.Forms.Button() Me.OrangeRed = New System.Windows.Forms.Button() Me.BluePurple = New System.Windows.Forms.Button() Me.GreenBlue = New System.Windows.Forms.Button() Me.CadetBlue = New System.Windows.Forms.Button() Me.Yell = New System.Windows.Forms.Timer(Me.components) Me.Blu = New System.Windows.Forms.Timer(Me.components) Me.Button8 = New System.Windows.Forms.Button() Me.Button10 = New System.Windows.Forms.Button() Me.GroupBox5 = New System.Windows.Forms.GroupBox() Me.Analyse = New System.Windows.Forms.Timer(Me.components) Me.GroupBox4.SuspendLayout() Me.GroupBox2.SuspendLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TrackBar2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TrackBar3, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox3.SuspendLayout() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox1.SuspendLayout() CType(Me.picCapture, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox5.SuspendLayout() Me.SuspendLayout() ' 'sfdImage ' Me.sfdImage.FileName = "Webcam1" Me.sfdImage.Filter = "Bitmap|*.bmp" ' 'RectangleShape3 ' Me.RectangleShape3.BorderWidth = 3 Me.RectangleShape3.CornerRadius = 10 Me.RectangleShape3.Location = New System.Drawing.Point(446, 9) Me.RectangleShape3.Name = "RectangleShape3" Me.RectangleShape3.Size = New System.Drawing.Size(176, 121) ' 'Label16 ' Me.Label16.AutoSize = True

Page 42: Color Mixer Machine

42

Me.Label16.FlatStyle = System.Windows.Forms.FlatStyle.Popup Me.Label16.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label16.Location = New System.Drawing.Point(301, 8) Me.Label16.Name = "Label16" Me.Label16.Size = New System.Drawing.Size(286, 33) Me.Label16.TabIndex = 38 Me.Label16.Text = "Color Mixer Control" ' 'GroupBox4 ' Me.GroupBox4.Controls.Add(Me.Button4) Me.GroupBox4.Controls.Add(Me.Button3) Me.GroupBox4.Location = New System.Drawing.Point(778, 3) Me.GroupBox4.Name = "GroupBox4" Me.GroupBox4.Size = New System.Drawing.Size(98, 40) Me.GroupBox4.TabIndex = 39 Me.GroupBox4.TabStop = False ' 'Button4 ' Me.Button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch Me.Button4.Image = Global.Webcam.My.Resources.Resources.help Me.Button4.Location = New System.Drawing.Point(5, 12) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(35, 23) Me.Button4.TabIndex = 37 Me.Button4.UseVisualStyleBackColor = True ' 'Button3 ' Me.Button3.BackgroundImage = Global.Webcam.My.Resources.Resources.close Me.Button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch Me.Button3.Image = Global.Webcam.My.Resources.Resources.close Me.Button3.Location = New System.Drawing.Point(47, 11) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(45, 23) Me.Button3.TabIndex = 36 Me.Button3.UseVisualStyleBackColor = True ' 'lstDevices ' Me.lstDevices.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lstDevices.Location = New System.Drawing.Point(132, 141) Me.lstDevices.Name = "lstDevices" Me.lstDevices.Size = New System.Drawing.Size(207, 17) Me.lstDevices.TabIndex = 1

Page 43: Color Mixer Machine

43

' 'lblDevice ' Me.lblDevice.AutoSize = True Me.lblDevice.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblDevice.Location = New System.Drawing.Point(9, 141) Me.lblDevice.Name = "lblDevice" Me.lblDevice.Size = New System.Drawing.Size(113, 13) Me.lblDevice.TabIndex = 2 Me.lblDevice.Text = "Available Devices:" Me.lblDevice.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'ProgressBar4 ' Me.ProgressBar4.ForeColor = System.Drawing.Color.Red Me.ProgressBar4.Location = New System.Drawing.Point(202, 41) Me.ProgressBar4.Maximum = 255 Me.ProgressBar4.Name = "ProgressBar4" Me.ProgressBar4.Size = New System.Drawing.Size(137, 19) Me.ProgressBar4.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar4.TabIndex = 9 ' 'ProgressBar5 ' Me.ProgressBar5.ForeColor = System.Drawing.Color.Red Me.ProgressBar5.Location = New System.Drawing.Point(51, 41) Me.ProgressBar5.Maximum = 255 Me.ProgressBar5.Name = "ProgressBar5" Me.ProgressBar5.Size = New System.Drawing.Size(137, 19) Me.ProgressBar5.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar5.TabIndex = 10 ' 'ProgressBar7 ' Me.ProgressBar7.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer)) Me.ProgressBar7.Location = New System.Drawing.Point(51, 75) Me.ProgressBar7.Maximum = 255 Me.ProgressBar7.Name = "ProgressBar7" Me.ProgressBar7.Size = New System.Drawing.Size(137, 19) Me.ProgressBar7.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar7.TabIndex = 12 ' 'ProgressBar9 ' Me.ProgressBar9.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer)) Me.ProgressBar9.Location = New System.Drawing.Point(51, 106) Me.ProgressBar9.Maximum = 255 Me.ProgressBar9.Name = "ProgressBar9"

Page 44: Color Mixer Machine

44

Me.ProgressBar9.Size = New System.Drawing.Size(137, 19) Me.ProgressBar9.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar9.TabIndex = 14 ' 'ProgressBar6 ' Me.ProgressBar6.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer)) Me.ProgressBar6.Location = New System.Drawing.Point(202, 75) Me.ProgressBar6.Maximum = 255 Me.ProgressBar6.Name = "ProgressBar6" Me.ProgressBar6.Size = New System.Drawing.Size(137, 19) Me.ProgressBar6.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar6.TabIndex = 11 ' 'ProgressBar8 ' Me.ProgressBar8.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer)) Me.ProgressBar8.Location = New System.Drawing.Point(202, 106) Me.ProgressBar8.Maximum = 255 Me.ProgressBar8.Name = "ProgressBar8" Me.ProgressBar8.Size = New System.Drawing.Size(137, 19) Me.ProgressBar8.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar8.TabIndex = 13 ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(29, 41) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(15, 20) Me.Label4.TabIndex = 19 Me.Label4.Text = "-" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label5.Location = New System.Drawing.Point(29, 73) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(15, 20) Me.Label5.TabIndex = 20 Me.Label5.Text = "-" ' 'Label6 ' Me.Label6.AutoSize = True

Page 45: Color Mixer Machine

45

Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label6.Location = New System.Drawing.Point(29, 106) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(15, 20) Me.Label6.TabIndex = 21 Me.Label6.Text = "-" ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label7.Location = New System.Drawing.Point(343, 41) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(19, 20) Me.Label7.TabIndex = 22 Me.Label7.Text = "+" ' 'Label8 ' Me.Label8.AutoSize = True Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label8.Location = New System.Drawing.Point(343, 73) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(19, 20) Me.Label8.TabIndex = 23 Me.Label8.Text = "+" ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label9.Location = New System.Drawing.Point(343, 106) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(19, 20) Me.Label9.TabIndex = 24 Me.Label9.Text = "+" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.PictureBox1) Me.GroupBox2.Controls.Add(Me.Label9) Me.GroupBox2.Controls.Add(Me.Label8) Me.GroupBox2.Controls.Add(Me.Label7) Me.GroupBox2.Controls.Add(Me.Label6) Me.GroupBox2.Controls.Add(Me.Label5) Me.GroupBox2.Controls.Add(Me.Label4) Me.GroupBox2.Controls.Add(Me.ProgressBar8)

Page 46: Color Mixer Machine

46

Me.GroupBox2.Controls.Add(Me.ProgressBar6) Me.GroupBox2.Controls.Add(Me.lstDevices) Me.GroupBox2.Controls.Add(Me.lblDevice) Me.GroupBox2.Controls.Add(Me.ProgressBar9) Me.GroupBox2.Controls.Add(Me.ProgressBar7) Me.GroupBox2.Controls.Add(Me.ProgressBar5) Me.GroupBox2.Controls.Add(Me.ProgressBar4) Me.GroupBox2.Controls.Add(Me.ShapeContainer3) Me.GroupBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox2.Location = New System.Drawing.Point(21, 439) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(646, 171) Me.GroupBox2.TabIndex = 25 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "RGB Difference" ' 'PictureBox1 ' Me.PictureBox1.Location = New System.Drawing.Point(477, 41) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(128, 91) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 34 Me.PictureBox1.TabStop = False ' 'ShapeContainer3 ' Me.ShapeContainer3.Location = New System.Drawing.Point(3, 19) Me.ShapeContainer3.Margin = New System.Windows.Forms.Padding(0) Me.ShapeContainer3.Name = "ShapeContainer3" Me.ShapeContainer3.Shapes.AddRange(New Microsoft.VisualBasic.PowerPacks.Shape() {Me.RectangleShape3}) Me.ShapeContainer3.Size = New System.Drawing.Size(640, 149) Me.ShapeContainer3.TabIndex = 25 Me.ShapeContainer3.TabStop = False ' 'Label13 ' Me.Label13.AutoSize = True Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label13.Location = New System.Drawing.Point(345, 38) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(32, 17) Me.Label13.TabIndex = 34 Me.Label13.Text = "000" ' 'Label14

Page 47: Color Mixer Machine

47

' Me.Label14.AutoSize = True Me.Label14.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label14.Location = New System.Drawing.Point(345, 76) Me.Label14.Name = "Label14" Me.Label14.Size = New System.Drawing.Size(32, 17) Me.Label14.TabIndex = 35 Me.Label14.Text = "000" ' 'Label15 ' Me.Label15.AutoSize = True Me.Label15.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label15.Location = New System.Drawing.Point(345, 110) Me.Label15.Name = "Label15" Me.Label15.Size = New System.Drawing.Size(32, 17) Me.Label15.TabIndex = 36 Me.Label15.Text = "000" ' 'ShapeContainer1 ' Me.ShapeContainer1.Location = New System.Drawing.Point(3, 15) Me.ShapeContainer1.Margin = New System.Windows.Forms.Padding(0) Me.ShapeContainer1.Name = "ShapeContainer1" Me.ShapeContainer1.Shapes.AddRange(New Microsoft.VisualBasic.PowerPacks.Shape() {Me.RectangleShape1}) Me.ShapeContainer1.Size = New System.Drawing.Size(651, 190) Me.ShapeContainer1.TabIndex = 33 Me.ShapeContainer1.TabStop = False ' 'RectangleShape1 ' Me.RectangleShape1.BorderWidth = 2 Me.RectangleShape1.CornerRadius = 5 Me.RectangleShape1.Location = New System.Drawing.Point(455, 23) Me.RectangleShape1.Name = "RectangleShape1" Me.RectangleShape1.Size = New System.Drawing.Size(176, 123) ' 'TrackBar1 ' Me.TrackBar1.AutoSize = False Me.TrackBar1.BackColor = System.Drawing.Color.Salmon Me.TrackBar1.Location = New System.Drawing.Point(64, 33) Me.TrackBar1.Maximum = 255 Me.TrackBar1.Name = "TrackBar1" Me.TrackBar1.Size = New System.Drawing.Size(280, 26) Me.TrackBar1.TabIndex = 26

Page 48: Color Mixer Machine

48

Me.TrackBar1.Value = 1 ' 'TrackBar2 ' Me.TrackBar2.AutoSize = False Me.TrackBar2.BackColor = System.Drawing.Color.Khaki Me.TrackBar2.Location = New System.Drawing.Point(64, 68) Me.TrackBar2.Maximum = 255 Me.TrackBar2.Name = "TrackBar2" Me.TrackBar2.Size = New System.Drawing.Size(280, 26) Me.TrackBar2.TabIndex = 27 Me.TrackBar2.Value = 1 ' 'TrackBar3 ' Me.TrackBar3.AutoSize = False Me.TrackBar3.BackColor = System.Drawing.Color.PowderBlue Me.TrackBar3.Location = New System.Drawing.Point(64, 107) Me.TrackBar3.Maximum = 255 Me.TrackBar3.Name = "TrackBar3" Me.TrackBar3.Size = New System.Drawing.Size(280, 26) Me.TrackBar3.TabIndex = 28 Me.TrackBar3.Value = 1 ' 'Label10 ' Me.Label10.AutoSize = True Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label10.Location = New System.Drawing.Point(12, 40) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(30, 13) Me.Label10.TabIndex = 29 Me.Label10.Text = "Red" ' 'Label11 ' Me.Label11.AutoSize = True Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label11.Location = New System.Drawing.Point(12, 74) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(44, 13) Me.Label11.TabIndex = 30 Me.Label11.Text = "Yellow" ' 'Label12 ' Me.Label12.AutoSize = True Me.Label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

Page 49: Color Mixer Machine

49

Me.Label12.Location = New System.Drawing.Point(12, 107) Me.Label12.Name = "Label12" Me.Label12.Size = New System.Drawing.Size(32, 13) Me.Label12.TabIndex = 31 Me.Label12.Text = "Blue" ' 'GroupBox3 ' Me.GroupBox3.Controls.Add(Me.Button6) Me.GroupBox3.Controls.Add(Me.Button18) Me.GroupBox3.Controls.Add(Me.Button19) Me.GroupBox3.Controls.Add(Me.Button17) Me.GroupBox3.Controls.Add(Me.Button16) Me.GroupBox3.Controls.Add(Me.TrackBar2) Me.GroupBox3.Controls.Add(Me.PictureBox2) Me.GroupBox3.Controls.Add(Me.Label12) Me.GroupBox3.Controls.Add(Me.Label11) Me.GroupBox3.Controls.Add(Me.Label10) Me.GroupBox3.Controls.Add(Me.TrackBar3) Me.GroupBox3.Controls.Add(Me.TrackBar1) Me.GroupBox3.Controls.Add(Me.ShapeContainer1) Me.GroupBox3.Controls.Add(Me.Label15) Me.GroupBox3.Controls.Add(Me.Label14) Me.GroupBox3.Controls.Add(Me.Label13) Me.GroupBox3.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox3.Location = New System.Drawing.Point(16, 49) Me.GroupBox3.Name = "GroupBox3" Me.GroupBox3.Size = New System.Drawing.Size(657, 208) Me.GroupBox3.TabIndex = 32 Me.GroupBox3.TabStop = False Me.GroupBox3.Text = "Manual Control" ' 'Button6 ' Me.Button6.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button6.Location = New System.Drawing.Point(318, 162) Me.Button6.Name = "Button6" Me.Button6.Size = New System.Drawing.Size(63, 23) Me.Button6.TabIndex = 38 Me.Button6.Text = "Reset" Me.Button6.UseVisualStyleBackColor = True ' 'Button18 ' Me.Button18.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button18.Location = New System.Drawing.Point(249, 162) Me.Button18.Name = "Button18" Me.Button18.Size = New System.Drawing.Size(63, 23)

Page 50: Color Mixer Machine

50

Me.Button18.TabIndex = 51 Me.Button18.Text = "Stop" Me.Button18.UseVisualStyleBackColor = True ' 'Button19 ' Me.Button19.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button19.Location = New System.Drawing.Point(182, 162) Me.Button19.Name = "Button19" Me.Button19.Size = New System.Drawing.Size(62, 23) Me.Button19.TabIndex = 52 Me.Button19.Text = "Blue" Me.Button19.UseVisualStyleBackColor = True ' 'Button17 ' Me.Button17.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button17.Location = New System.Drawing.Point(114, 162) Me.Button17.Name = "Button17" Me.Button17.Size = New System.Drawing.Size(63, 23) Me.Button17.TabIndex = 50 Me.Button17.Text = "Yellow" Me.Button17.UseVisualStyleBackColor = True ' 'Button16 ' Me.Button16.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button16.Location = New System.Drawing.Point(47, 162) Me.Button16.Name = "Button16" Me.Button16.Size = New System.Drawing.Size(62, 23) Me.Button16.TabIndex = 49 Me.Button16.Text = "Red" Me.Button16.UseVisualStyleBackColor = True ' 'PictureBox2 ' Me.PictureBox2.BackColor = System.Drawing.Color.White Me.PictureBox2.Location = New System.Drawing.Point(483, 53) Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Size = New System.Drawing.Size(128, 92) Me.PictureBox2.TabIndex = 32 Me.PictureBox2.TabStop = False ' 'ShapeContainer2 ' Me.ShapeContainer2.Location = New System.Drawing.Point(3, 15) Me.ShapeContainer2.Margin = New System.Windows.Forms.Padding(0) Me.ShapeContainer2.Name = "ShapeContainer2"

Page 51: Color Mixer Machine

51

Me.ShapeContainer2.Shapes.AddRange(New Microsoft.VisualBasic.PowerPacks.Shape() {Me.RectangleShape2}) Me.ShapeContainer2.Size = New System.Drawing.Size(646, 152) Me.ShapeContainer2.TabIndex = 18 Me.ShapeContainer2.TabStop = False ' 'RectangleShape2 ' Me.RectangleShape2.BorderWidth = 3 Me.RectangleShape2.CornerRadius = 5 Me.RectangleShape2.Location = New System.Drawing.Point(452, 8) Me.RectangleShape2.Name = "RectangleShape2" Me.RectangleShape2.Size = New System.Drawing.Size(176, 121) ' 'ProgressBar1 ' Me.ProgressBar1.ForeColor = System.Drawing.Color.Red Me.ProgressBar1.Location = New System.Drawing.Point(62, 38) Me.ProgressBar1.Maximum = 255 Me.ProgressBar1.Name = "ProgressBar1" Me.ProgressBar1.Size = New System.Drawing.Size(280, 19) Me.ProgressBar1.Step = 1 Me.ProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar1.TabIndex = 6 ' 'ProgressBar2 ' Me.ProgressBar2.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer)) Me.ProgressBar2.Location = New System.Drawing.Point(62, 68) Me.ProgressBar2.Maximum = 255 Me.ProgressBar2.Name = "ProgressBar2" Me.ProgressBar2.Size = New System.Drawing.Size(280, 19) Me.ProgressBar2.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar2.TabIndex = 7 ' 'ProgressBar3 ' Me.ProgressBar3.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer)) Me.ProgressBar3.Location = New System.Drawing.Point(62, 98) Me.ProgressBar3.Maximum = 255 Me.ProgressBar3.Name = "ProgressBar3" Me.ProgressBar3.Size = New System.Drawing.Size(280, 19) Me.ProgressBar3.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar3.TabIndex = 8 ' 'Label1 ' Me.Label1.AutoSize = True

Page 52: Color Mixer Machine

52

Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(12, 40) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(30, 13) Me.Label1.TabIndex = 15 Me.Label1.Text = "Red" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(12, 69) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(41, 13) Me.Label2.TabIndex = 16 Me.Label2.Text = "Green" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(12, 100) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(32, 13) Me.Label3.TabIndex = 17 Me.Label3.Text = "Blue" ' 'btnStart ' Me.btnStart.AutoSize = True Me.btnStart.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnStart.Location = New System.Drawing.Point(44, 133) Me.btnStart.Name = "btnStart" Me.btnStart.Size = New System.Drawing.Size(68, 24) Me.btnStart.TabIndex = 3 Me.btnStart.Text = "Capture" ' 'btnStop ' Me.btnStop.AutoSize = True Me.btnStop.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnStop.Location = New System.Drawing.Point(112, 133) Me.btnStop.Name = "btnStop" Me.btnStop.Size = New System.Drawing.Size(62, 24) Me.btnStop.TabIndex = 5 Me.btnStop.Text = "Stop"

Page 53: Color Mixer Machine

53

' 'Button1 ' Me.Button1.Enabled = False Me.Button1.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(179, 133) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(63, 24) Me.Button1.TabIndex = 33 Me.Button1.Text = "Analyis" Me.Button1.UseVisualStyleBackColor = True ' 'Button2 ' Me.Button2.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button2.Location = New System.Drawing.Point(316, 133) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(62, 24) Me.Button2.TabIndex = 36 Me.Button2.Text = "Exit" Me.Button2.UseVisualStyleBackColor = True ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.Button5) Me.GroupBox1.Controls.Add(Me.Label19) Me.GroupBox1.Controls.Add(Me.Label18) Me.GroupBox1.Controls.Add(Me.Label17) Me.GroupBox1.Controls.Add(Me.Button2) Me.GroupBox1.Controls.Add(Me.Button1) Me.GroupBox1.Controls.Add(Me.btnStop) Me.GroupBox1.Controls.Add(Me.btnStart) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.Label2) Me.GroupBox1.Controls.Add(Me.Label1) Me.GroupBox1.Controls.Add(Me.ProgressBar3) Me.GroupBox1.Controls.Add(Me.ProgressBar2) Me.GroupBox1.Controls.Add(Me.ProgressBar1) Me.GroupBox1.Controls.Add(Me.picCapture) Me.GroupBox1.Controls.Add(Me.ShapeContainer2) Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox1.Location = New System.Drawing.Point(18, 263) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(652, 170) Me.GroupBox1.TabIndex = 18 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Output" '

Page 54: Color Mixer Machine

54

'Button5 ' Me.Button5.Font = New System.Drawing.Font("Verdana", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button5.Location = New System.Drawing.Point(247, 133) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(62, 24) Me.Button5.TabIndex = 68 Me.Button5.Text = "Save" Me.Button5.UseVisualStyleBackColor = True ' 'Label19 ' Me.Label19.AutoSize = True Me.Label19.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label19.Location = New System.Drawing.Point(345, 100) Me.Label19.Name = "Label19" Me.Label19.Size = New System.Drawing.Size(32, 17) Me.Label19.TabIndex = 43 Me.Label19.Text = "000" ' 'Label18 ' Me.Label18.AutoSize = True Me.Label18.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label18.Location = New System.Drawing.Point(345, 69) Me.Label18.Name = "Label18" Me.Label18.Size = New System.Drawing.Size(32, 17) Me.Label18.TabIndex = 42 Me.Label18.Text = "000" ' 'Label17 ' Me.Label17.AutoSize = True Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label17.Location = New System.Drawing.Point(345, 39) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(32, 17) Me.Label17.TabIndex = 41 Me.Label17.Text = "000" ' 'picCapture ' Me.picCapture.Location = New System.Drawing.Point(480, 40) Me.picCapture.Name = "picCapture"

Page 55: Color Mixer Machine

55

Me.picCapture.Size = New System.Drawing.Size(129, 92) Me.picCapture.TabIndex = 0 Me.picCapture.TabStop = False ' 'Olive ' Me.Olive.BackColor = System.Drawing.Color.Indigo Me.Olive.Location = New System.Drawing.Point(25, 253) Me.Olive.Name = "Olive" Me.Olive.Size = New System.Drawing.Size(85, 20) Me.Olive.TabIndex = 55 Me.Olive.UseVisualStyleBackColor = False ' 'Magenta ' Me.Magenta.BackColor = System.Drawing.Color.Crimson Me.Magenta.Location = New System.Drawing.Point(25, 353) Me.Magenta.Name = "Magenta" Me.Magenta.Size = New System.Drawing.Size(85, 20) Me.Magenta.TabIndex = 64 Me.Magenta.UseVisualStyleBackColor = False ' 'Purple ' Me.Purple.BackColor = System.Drawing.Color.Purple Me.Purple.Location = New System.Drawing.Point(25, 225) Me.Purple.Name = "Purple" Me.Purple.Size = New System.Drawing.Size(85, 20) Me.Purple.TabIndex = 63 Me.Purple.UseVisualStyleBackColor = False ' ' Me.Yellow.BackColor = System.Drawing.Color.Yellow Me.Yellow.Location = New System.Drawing.Point(25, 100) Me.Yellow.Name = "Yellow" Me.Yellow.Size = New System.Drawing.Size(85, 20) Me.Yellow.TabIndex = 53 Me.Yellow.UseVisualStyleBackColor = False ' 'Red ' Me.Red.BackColor = System.Drawing.Color.Red Me.Red.Location = New System.Drawing.Point(25, 27) Me.Red.Name = "Red" Me.Red.Size = New System.Drawing.Size(85, 20) Me.Red.TabIndex = 54 Me.Red.UseVisualStyleBackColor = False ' 'Green ' Me.Green.BackColor = System.Drawing.Color.Lime

Page 56: Color Mixer Machine

56

Me.Green.Location = New System.Drawing.Point(25, 150) Me.Green.Name = "Green" Me.Green.Size = New System.Drawing.Size(85, 20) Me.Green.TabIndex = 56 Me.Green.UseVisualStyleBackColor = False ' 'YellowGreen ' Me.YellowGreen.BackColor = System.Drawing.Color.GreenYellow Me.YellowGreen.Location = New System.Drawing.Point(25, 125) Me.YellowGreen.Name = "YellowGreen" Me.YellowGreen.Size = New System.Drawing.Size(85, 20) Me.YellowGreen.TabIndex = 57 Me.YellowGreen.UseVisualStyleBackColor = False ' 'Orange ' Me.Orange.BackColor = System.Drawing.Color.Orange Me.Orange.Location = New System.Drawing.Point(25, 75) Me.Orange.Name = "Orange" Me.Orange.Size = New System.Drawing.Size(85, 19) Me.Orange.TabIndex = 59 Me.Orange.UseVisualStyleBackColor = False ' 'OrangeRed ' Me.OrangeRed.BackColor = System.Drawing.Color.OrangeRed Me.OrangeRed.Location = New System.Drawing.Point(25, 49) Me.OrangeRed.Name = "OrangeRed" Me.OrangeRed.Size = New System.Drawing.Size(85, 20) Me.OrangeRed.TabIndex = 60 Me.OrangeRed.UseVisualStyleBackColor = False ' 'BluePurple ' Me.BluePurple.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) Me.BluePurple.Location = New System.Drawing.Point(25, 302) Me.BluePurple.Name = "BluePurple" Me.BluePurple.Size = New System.Drawing.Size(85, 20) Me.BluePurple.TabIndex = 61 Me.BluePurple.UseVisualStyleBackColor = False ' 'GreenBlue ' Me.GreenBlue.BackColor = System.Drawing.Color.SeaGreen Me.GreenBlue.Location = New System.Drawing.Point(25, 200) Me.GreenBlue.Name = "GreenBlue" Me.GreenBlue.Size = New System.Drawing.Size(85, 20) Me.GreenBlue.TabIndex = 62 Me.GreenBlue.UseVisualStyleBackColor = False

Page 57: Color Mixer Machine

57

' 'CadetBlue ' Me.CadetBlue.BackColor = System.Drawing.Color.Blue Me.CadetBlue.Location = New System.Drawing.Point(25, 277) Me.CadetBlue.Name = "CadetBlue" Me.CadetBlue.Size = New System.Drawing.Size(85, 20) Me.CadetBlue.TabIndex = 65 Me.CadetBlue.UseVisualStyleBackColor = False ' 'Blu ' ' 'Button8 ' Me.Button8.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer)) Me.Button8.Location = New System.Drawing.Point(25, 175) Me.Button8.Name = "Button8" Me.Button8.Size = New System.Drawing.Size(85, 20) Me.Button8.TabIndex = 66 Me.Button8.UseVisualStyleBackColor = False ' 'Button10 ' Me.Button10.BackColor = System.Drawing.Color.Firebrick Me.Button10.Location = New System.Drawing.Point(25, 328) Me.Button10.Name = "Button10" Me.Button10.Size = New System.Drawing.Size(85, 20) Me.Button10.TabIndex = 66 Me.Button10.UseVisualStyleBackColor = False ' 'GroupBox5 ' Me.GroupBox5.Controls.Add(Me.Olive) Me.GroupBox5.Controls.Add(Me.Purple) Me.GroupBox5.Controls.Add(Me.Magenta) Me.GroupBox5.Controls.Add(Me.Button10) Me.GroupBox5.Controls.Add(Me.BluePurple) Me.GroupBox5.Controls.Add(Me.Button8) Me.GroupBox5.Controls.Add(Me.CadetBlue) Me.GroupBox5.Controls.Add(Me.GreenBlue) Me.GroupBox5.Controls.Add(Me.OrangeRed) Me.GroupBox5.Controls.Add(Me.Orange) Me.GroupBox5.Controls.Add(Me.YellowGreen) Me.GroupBox5.Controls.Add(Me.Green) Me.GroupBox5.Controls.Add(Me.Red) Me.GroupBox5.Controls.Add(Me.Yellow) Me.GroupBox5.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox5.Location = New System.Drawing.Point(715, 64)

Page 58: Color Mixer Machine

58

Me.GroupBox5.Name = "GroupBox5" Me.GroupBox5.Size = New System.Drawing.Size(130, 385) Me.GroupBox5.TabIndex = 67 Me.GroupBox5.TabStop = False Me.GroupBox5.Text = "Automatic Control" ' 'Analyse ' ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(888, 706) Me.Controls.Add(Me.GroupBox5) Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.GroupBox4) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.Label16) Me.Controls.Add(Me.GroupBox2) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Name = "Form1" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Video Capture" Me.GroupBox4.ResumeLayout(False) Me.GroupBox2.ResumeLayout(False) Me.GroupBox2.PerformLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TrackBar2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TrackBar3, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox3.ResumeLayout(False) Me.GroupBox3.PerformLayout() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() CType(Me.picCapture, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox5.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() End Sub #End Region Const WM_CAP As Short = &H400S Const WM_CAP_DRIVER_CONNECT As Integer = WM_CAP + 10 Const WM_CAP_DRIVER_DISCONNECT As Integer = WM_CAP + 11 Const WM_CAP_EDIT_COPY As Integer = WM_CAP + 30 Const WM_CAP_SET_PREVIEW As Integer = WM_CAP + 50

Page 59: Color Mixer Machine

59

Const WM_CAP_SET_PREVIEWRATE As Integer = WM_CAP + 52 Const WM_CAP_SET_SCALE As Integer = WM_CAP + 53 Const WS_CHILD As Integer = &H40000000 Const WS_VISIBLE As Integer = &H10000000 Const SWP_NOMOVE As Short = &H2S Const SWP_NOSIZE As Short = 1 Const SWP_NOZORDER As Short = &H4S Const HWND_BOTTOM As Short = 1 Dim iDevice As Integer = 2 ' Current device ID Dim hHwnd As Integer ' Handle to preview window Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, _ <MarshalAs(UnmanagedType.AsAny)> ByVal lParam As Object) As Integer Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Integer, _ ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, _ ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer Declare Function DestroyWindow Lib "user32" (ByVal hndw As Integer) As Boolean Declare Function capCreateCaptureWindowA Lib "avicap32.dll" _ (ByVal lpszWindowName As String, ByVal dwStyle As Integer, _ ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, _ ByVal nHeight As Short, ByVal hWndParent As Integer, _ ByVal nID As Integer) As Integer Declare Function capGetDriverDescriptionA Lib "avicap32.dll" (ByVal wDriver As Short, _ ByVal lpszName As String, ByVal cbName As Integer, ByVal lpszVer As String, _ ByVal cbVer As Integer) As Boolean Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load LoadDeviceList() If lstDevices.Items.Count > 0 Then lstDevices.SelectedIndex = 0 btnStart.Enabled = True Else lstDevices.Items.Add("No Capture Device") btnStart.Enabled = False End If btnStop.Enabled = False picCapture.SizeMode = PictureBoxSizeMode.StretchImage If serialP.IsOpen Then

Page 60: Color Mixer Machine

60

serialP.Close() End If Try With serialP .PortName = "COM3" .BaudRate = 9600 .Parity = IO.Ports.Parity.None .DataBits = 8 .StopBits = IO.Ports.StopBits.One .Handshake = IO.Ports.Handshake.None End With serialP.Open() Catch ex As Exception MsgBox(ex.ToString) End Try End Sub Private Sub LoadDeviceList() Dim strName As String = Space(100) Dim strVer As String = Space(100) Dim bReturn As Boolean Dim x As Integer = 0 ' ' Load name of all avialable devices into the lstDevices ' Do ' ' Get Driver name and version ' bReturn = capGetDriverDescriptionA(x, strName, 100, strVer, 100) ' ' If there was a device add device name to the list ' If bReturn Then lstDevices.Items.Add(strName.Trim) x += 1 Loop Until bReturn = False End Sub Private Sub OpenPreviewWindow() Dim iHeight As Integer = picCapture.Height Dim iWidth As Integer = picCapture.Width ' ' Open Preview window in picturebox ' hHwnd = capCreateCaptureWindowA(iDevice, WS_VISIBLE Or WS_CHILD, 0, 0, 640, _ 480, picCapture.Handle.ToInt32, 0)

Page 61: Color Mixer Machine

61

' ' Connect to device ' If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then ' 'Set the preview scale ' SendMessage(hHwnd, WM_CAP_SET_SCALE, True, 0) ' 'Set the preview rate in milliseconds ' SendMessage(hHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0) ' 'Start previewing the image from the camera ' SendMessage(hHwnd, WM_CAP_SET_PREVIEW, True, 0) ' ' Resize window to fit in picturebox ' SetWindowPos(hHwnd, HWND_BOTTOM, 0, 0, picCapture.Width, picCapture.Height, _ SWP_NOMOVE Or SWP_NOZORDER) btnStop.Enabled = True btnStart.Enabled = False Else ' ' Error connecting to device close window ' MessageBox.Show("jhg") DestroyWindow(hHwnd) End If picCapture.Image = PictureBox1.Image End Sub Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click iDevice = lstDevices.SelectedIndex OpenPreviewWindow() Button1.Enabled = True btnStop.Enabled = True btnStart.Enabled = False End Sub Private Sub ClosePreviewWindow()

Page 62: Color Mixer Machine

62

' ' Disconnect from device ' SendMessage(hHwnd, WM_CAP_DRIVER_DISCONNECT, iDevice, 0) ' ' close window ' DestroyWindow(hHwnd) End Sub Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click ClosePreviewWindow() Button1.Enabled = False btnStart.Enabled = True btnStop.Enabled = False End Sub Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If btnStop.Enabled Then ClosePreviewWindow() End If End Sub Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll Label13.Text = TrackBar1.Value a = TrackBar1.Value b = TrackBar2.Value c = TrackBar3.Value PictureBox2.BackColor = Color.FromArgb(a, b, c) End Sub Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll Label14.Text = TrackBar2.Value a = TrackBar1.Value b = TrackBar2.Value c = TrackBar3.Value PictureBox2.BackColor = Color.FromArgb(a, b, c) End Sub

Page 63: Color Mixer Machine

63

Private Sub TrackBar3_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar3.Scroll Label15.Text = TrackBar3.Value a = TrackBar1.Value b = TrackBar2.Value c = TrackBar3.Value PictureBox2.BackColor = Color.FromArgb(a, b, c) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) ProgressBar4.Value = 0 ProgressBar5.Value = 0 ProgressBar6.Value = 0 ProgressBar7.Value = 0 ProgressBar8.Value = 0 ProgressBar9.Value = 0 SendMessage(hHwnd, WM_CAP_EDIT_COPY, 0, 0) ' ' Get image from clipboard and convert it to a bitmap ' data = Clipboard.GetDataObject() If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then bmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Image) PictureBox1.Image = bmap End If i = i + 1 Dim R, G, B As Long Dim r_color1 As Color Dim r_color2 As Color Dim r_color3 As Color Dim r_color4 As Color Dim r_color5 As Color Dim r_color6 As Color Dim picture_b As New Bitmap(PictureBox1.Image) r_color1 = picture_b.GetPixel(1, 1) r_color2 = picture_b.GetPixel(1, 20) r_color3 = picture_b.GetPixel(1, 40) r_color4 = picture_b.GetPixel(40, 1) r_color5 = picture_b.GetPixel(40, 20) r_color6 = picture_b.GetPixel(40, 40) R = (Val(r_color1.R) + Val(r_color2.R) + Val(r_color3.R) + Val(r_color4.R) + Val(r_color5.R) + Val(r_color6.R)) / 6 G = (Val(r_color1.G) + Val(r_color2.G) + Val(r_color3.G) + Val(r_color4.G) + Val(r_color5.G) + Val(r_color6.G)) / 6 B = (Val(r_color1.B) + Val(r_color2.B) + Val(r_color3.B) + Val(r_color4.B) + Val(r_color5.B) + Val(r_color6.B)) / 6

Page 64: Color Mixer Machine

64

ProgressBar1.Value = R ProgressBar2.Value = G ProgressBar3.Value = B 'R.Enabled = False Label17.Text = ProgressBar1.Value Label18.Text = ProgressBar2.Value Label19.Text = ProgressBar3.Value End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click btnStop.Enabled = False Button6.Enabled = False Button1.Enabled = False Analyse.Enabled = True End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Form2.Show() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Hide() Form2.Show() End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click TrackBar1.Value = 0 TrackBar2.Value = 0 TrackBar3.Value = 0 ProgressBar1.Value = 0 ProgressBar2.Value = 0 ProgressBar3.Value = 0 ProgressBar4.Value = 0 ProgressBar5.Value = 0 ProgressBar6.Value = 0 ProgressBar7.Value = 0 ProgressBar8.Value = 0 ProgressBar9.Value = 0 End Sub Private Sub RYB() serialP.Write("1")

Page 65: Color Mixer Machine

65

RYB1.Interval = ((TrackBar1.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 RYB1.Enabled = True End Sub Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click serialP.Write("1") End Sub Private Sub RYB1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RYB1.Tick serialP.Write("2") RYB2.Interval = ((TrackBar2.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 RYB2.Enabled = True RYB1.Enabled = False End Sub Private Sub RYB2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RYB2.Tick serialP.Write("3") Finish.Interval = ((TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 Finish.Enabled = True RYB2.Enabled = False End Sub Private Sub RedYellow() serialP.Write("1") RY1.Interval = ((TrackBar1.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 RY1.Enabled = True End Sub Private Sub YellowBlue() serialP.Write("2") YB1.Interval = ((TrackBar2.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 YB1.Enabled = True End Sub Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click serialP.Write("2") End Sub Private Sub RY1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RY1.Tick serialP.Write("2") Finish.Interval = ((TrackBar2.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 Finish.Enabled = True RY1.Enabled = False End Sub Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click

Page 66: Color Mixer Machine

66

serialP.Write("0") End Sub Private Sub YB1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles YB1.Tick serialP.Write("3") Finish.Interval = ((TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 Finish.Enabled = True YB1.Enabled = False End Sub Private Sub RB() serialP.Write("1") RB1.Interval = ((TrackBar1.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 RB1.Enabled = True End Sub Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click serialP.Write("3") End Sub Private Sub RB1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RB1.Tick serialP.Write("3") Finish.Interval = ((TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 Finish.Enabled = True RB1.Enabled = False End Sub Private Sub Finish_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Finish.Tick serialP.Write("0") Finish.Enabled = False End Sub Private Sub Red_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Red.Click Dim X As Color X = Color.Red serialP.Write("1") TrackBar1.Value = 255 TrackBar2.Value = 1 TrackBar3.Value = 1 Finish.Interval = ((TrackBar1.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 Finish.Enabled = True End Sub

Page 67: Color Mixer Machine

67

Private Sub Yellow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Yellow.Click TrackBar1.Value = 1 TrackBar2.Value = 255 TrackBar3.Value = 1 serialP.Write("2") Finish.Interval = ((TrackBar2.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 Finish.Enabled = True End Sub Private Sub OrangeRed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OrangeRed.Click TrackBar1.Value = 255 TrackBar2.Value = 255 TrackBar3.Value = 1 RedYellow() End Sub Private Sub Orange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Orange.Click TrackBar1.Value = 70 TrackBar2.Value = 255 TrackBar3.Value = 1 RedYellow() End Sub Private Sub YellowGreen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles YellowGreen.Click TrackBar1.Value = 1 TrackBar2.Value = 255 TrackBar3.Value = 10 YellowBlue() End Sub Private Sub Green_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Green.Click TrackBar1.Value = 1 TrackBar2.Value = 255 TrackBar3.Value = 60 YellowBlue() End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click TrackBar1.Value = 1 TrackBar2.Value = 255 TrackBar3.Value = 200

Page 68: Color Mixer Machine

68

YellowBlue() End Sub Private Sub GreenBlue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GreenBlue.Click TrackBar1.Value = 1 TrackBar2.Value = 55 TrackBar3.Value = 255 YellowBlue() End Sub Private Sub CadetBlue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CadetBlue.Click TrackBar1.Value = 1 TrackBar2.Value = 1 TrackBar3.Value = 255 serialP.Write("3") Finish.Interval = ((TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)) * 100) * 200 Finish.Enabled = True End Sub Private Sub Blu_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Blu.Tick End Sub Private Sub Purple_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Purple.Click TrackBar1.Value = 200 TrackBar2.Value = 1 TrackBar3.Value = 220 RB() End Sub Private Sub Olive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Olive.Click TrackBar1.Value = 50 TrackBar2.Value = 1 TrackBar3.Value = 255 RYB() End Sub Private Sub BluePurple_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BluePurple.Click TrackBar1.Value = 150 TrackBar2.Value = 70 TrackBar3.Value = 255 RYB()

Page 69: Color Mixer Machine

69

End Sub Private Sub Magenta_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Magenta.Click TrackBar1.Value = 255 TrackBar2.Value = 30 TrackBar3.Value = 70 RYB() End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click TrackBar1.Value = 255 TrackBar2.Value = 255 TrackBar3.Value = 200 RYB() End Sub Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Button5_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click ' ' Copy image to clipboard ' SendMessage(hHwnd, WM_CAP_EDIT_COPY, 0, 0) ' ' Get image from clipboard and convert it to a bitmap ' data = Clipboard.GetDataObject() If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then bmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Image) PictureBox1.Image = bmap btnStart.Enabled = True If sfdImage.ShowDialog = DialogResult.OK Then bmap.Save(sfdImage.FileName, Imaging.ImageFormat.Bmp) End If End If

Page 70: Color Mixer Machine

70

End Sub Private Sub Analyse_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Analyse.Tick ProgressBar4.Value = 0 ProgressBar5.Value = 0 ProgressBar6.Value = 0 ProgressBar7.Value = 0 ProgressBar8.Value = 0 ProgressBar9.Value = 0 SendMessage(hHwnd, WM_CAP_EDIT_COPY, 0, 0) ' ' Get image from clipboard and convert it to a bitmap ' data = Clipboard.GetDataObject() If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then bmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Image) PictureBox1.Image = bmap End If i = i + 1 Dim r_color1 As Color Dim r_color2 As Color Dim r_color3 As Color Dim r_color4 As Color Dim r_color5 As Color Dim r_color6 As Color Dim picture_b As New Bitmap(PictureBox1.Image) r_color1 = picture_b.GetPixel(1, 1) r_color2 = picture_b.GetPixel(1, 20) r_color3 = picture_b.GetPixel(1, 40) r_color4 = picture_b.GetPixel(40, 1) r_color5 = picture_b.GetPixel(40, 20) r_color6 = picture_b.GetPixel(40, 40) R = (Val(r_color1.R) + Val(r_color2.R) + Val(r_color3.R) + Val(r_color4.R) + Val(r_color5.R) + Val(r_color6.R)) / 6 G = (Val(r_color1.G) + Val(r_color2.G) + Val(r_color3.G) + Val(r_color4.G) + Val(r_color5.G) + Val(r_color6.G)) / 6 B = (Val(r_color1.B) + Val(r_color2.B) + Val(r_color3.B) + Val(r_color4.B) + Val(r_color5.B) + Val(r_color6.B)) / 6 ProgressBar1.Value = R ProgressBar2.Value = G ProgressBar3.Value = B Analyse.Enabled = False Label17.Text = ProgressBar1.Value Label18.Text = ProgressBar2.Value Label19.Text = ProgressBar3.Value End Sub

Page 71: Color Mixer Machine

71

Private Sub GroupBox3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox3.Enter End Sub Private Sub Label16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label16.Click End Sub End Class

Basic Stamp

P-Basic Code

' {$STAMP BS2}

' {$PBASIC 2.5}

relay VAR Byte 'relay number storage variable

stat VAR Byte 'relay status ON/OFF variable

baud CON 16468 '9600,N,8,1

serpin CON 16 'serial I/O pin = 0

start:

DO

SERIN serpin,baud,[STR relay\1] 'serial data in on pin0

SELECT relay

CASE "0"

LOW 1

LOW 2

LOW 3

Page 72: Color Mixer Machine

72

CASE "1"

HIGH 1

LOW 2

LOW 3

CASE "2"

HIGH 2

LOW 1

LOW 3

CASE "3"

HIGH 3

LOW 1

LOW 2

CASE "4"

LOW 1

HIGH 2

HIGH 3

CASE "5"

HIGH 1

LOW 2

Page 73: Color Mixer Machine

73

HIGH 3

CASE "6"

HIGH 1

HIGH 2

LOW 3

ENDSELECT

LOOP

Page 74: Color Mixer Machine

74

14. Appendix II

Figure 14.1: Top holder for tanks

Figure 14.2: Base

Page 75: Color Mixer Machine

75

Figure 14.3: Side

Page 76: Color Mixer Machine

76

Figure 14.4 Control Circuit

Page 77: Color Mixer Machine

77

15. Appendix III

Price List

Part

No. Of

Pieces

Price/piece

LE Picture

Solenoid Valve 3 75

SumoBot Printed

Circuit Board 2 950

Hoses 3m 12

Parallax USB to

Serial (RS-232)

Adapter with

Cable

1 225

Page 78: Color Mixer Machine

78

Body 1 360

Webcam 1 180

Machine screw 24 0.25

Nut 10 .25

Total 1976

Page 79: Color Mixer Machine

79


Recommended