Click here to Skip to main content
15,881,139 members
Articles / Desktop Programming / Win32

Persian Gulf in 3D Anaglyph

Rate me:
Please Sign up or sign in to vote.
4.99/5 (74 votes)
12 Aug 2013CPOL19 min read 96.5K   5.4K   70  
This application uses some simple 2D methods to make 3D scenes which can be seen with Red/Cyan Anaglyph glasses.
  • Anaglyph_photoshop.zip
    • anaglyph-test1.psd
    • anaglyph-test2.psd
    • anaglyph-test3.psd
  • Anaglyph_src4.zip
    • Anaglyph
      • Anaglyph.sln
      • Anaglyph.suo
      • Anaglyph
        • Anaglyph.csproj
        • app.config
        • bin
          • Debug
            • Animals
              • bird-uid-1077009.png
              • dog-uid-1080734.png
              • flying-eagle-uid-1076271.png
              • Red_breasted_Robin_1024.png
              • Spotted-Reflections-at-the-Watering-Hole,-Leopard,-Africa.png
              • Thumbs.db
            • Birds
              • bird-uid-1077229.png
              • flying-eagle-uid-1076267.png
              • Thumbs.db
            • Clouds
              • 25vc.png
              • Peaceful-Formations,-Ocean-Beach,-Californi2a.png
              • Tahiti,-French-hhPolynesia.png
            • Fishes
              • A-Whale-of-a-Tail.png
              • dolphin06.png
              • Dolphin1.png
              • shark1.png
            • Flowers
              • Orange-Hibiscus.png
              • plantstalk-uid-1111070.png
              • Pressed-wildflower-L6.png
              • Thumbs.db
            • Ground
              • Thumbs.db
            • Misc
              • BUTERFLY.png
              • F22.png
              • sun.png
            • Rocks
              • 0207_vietnam.png
              • 78.png
              • rockdd4.png
            • Ships
              • 73.png
            • Snow
              • snow0.png
              • snow2.png
              • snow3.png
              • snow4.png
              • snow5.png
            • Trees
              • Thumbs.db
        • clsData.cs
        • frmAbout.cs
        • frmAbout.designer.cs
        • frmAbout.resx
        • frmEdit.cs
        • frmEdit.Designer.cs
        • frmEdit.resx
        • frmEditObjects.cs
        • frmEditObjects.Designer.cs
        • frmEditObjects.resx
        • frmEditOver.cs
        • frmEditOver.Designer.cs
        • frmEditOver.resx
        • frmMain.cs
        • frmMain.designer.cs
        • frmMain.resx
        • frmObject.cs
        • frmObject.designer.cs
        • frmObject.resx
        • frmSelection.cs
        • frmSelection.designer.cs
        • frmSelection.resx
        • Program.cs
        • Properties
        • Resources
          • _3D_farsian.JPG
          • _3D_galikesh.JPG
          • _3D_kavir.jpg
          • 008_Reminder_32x42_72.png
          • 009_HighPriority_48x48_72.png
          • 009_HighPriority_48x48_721.png
          • 010_LowPriority_32x32_72.png
          • 037_Colorize_32x32_72.png
          • 05dx.png
          • 05x.png
          • 0710.png
          • 109_AllAnnotations_Complete_32x42_72.png
          • 109_AllAnnotations_Default_32x42_72.png
          • 109_AllAnnotations_Default_32x42_721.png
          • 109_AllAnnotations_Error_32x42_72.png
          • 109_AllAnnotations_Error_32x42_721.png
          • 109_AllAnnotations_Help_32x42_72.png
          • 109_AllAnnotations_Help_32x42_721.png
          • 109_AllAnnotations_Info_32x42_72.png
          • 109_AllAnnotations_Info_32x42_721.png
          • 109_AllAnnotations_Warning_32x42_72.png
          • 109_AllAnnotations_Warning_32x42_721.png
          • 112_ArrowCurve_Blue_Left_32x42_72.png
          • 112_DownArrowLong_Orange_32x42_72.png
          • 112_DownArrowShort_Blue_32x42_72.png
          • 112_DownArrowShort_Grey_32x42_72.png
          • 112_DownArrowShort_Grey_32x42_721.png
          • 112_DownArrowShort_Orange_32x42_72.png
          • 112_LeftArrowShort_Blue_32x42_72.png
          • 112_LeftArrowShort_Green_32x42_72.png
          • 112_LeftArrowShort_Green_32x42_721.png
          • 112_LeftArrowShort_Grey_32x42_72.png
          • 112_LeftArrowShort_Grey_32x42_721.png
          • 112_LeftArrowShort_Orange_32x42_72.png
          • 112_LeftArrowShort_Orange_32x42_721.png
          • 112_Minus_Grey_32x42_72.png
          • 112_Minus_Grey_32x42_721.png
          • 112_Minus_Orange_32x42_72.png
          • 112_Plus_Blue_32x42_72.png
          • 112_Plus_Green_32x42_72.png
          • 112_Plus_Orange_32x42_72.png
          • 112_RefreshArrow_Blue_32x32.png
          • 112_RefreshArrow_Green_48x48_72.png
          • 112_RightArrowLong_Blue_32x42_72.png
          • 112_RightArrowLong_Green_32x42_72.png
          • 112_RightArrowLong_Grey_32x42_72.png
          • 112_RightArrowLong_Orange_32x42_72.png
          • 112_RightArrowShort_Green_32x42_72.png
          • 112_Tick_Blue_32x32_72.png
          • 112_Tick_Green_32x32_72.png
          • 112_Tick_Green_64x64_72.png
          • 112_Tick_Grey_32x32_72.png
          • 112_Tick_Orange_32x32_72.png
          • 112_UpArrowLong_Blue_32x42_72.png
          • 112_UpArrowLong_Green_32x42_72.png
          • 112_UpArrowLong_Orange_32x42_72.png
          • 112_UpArrowShort_Blue_32x42_72.png
          • 112_UpArrowShort_Green_32x42_72.png
          • 112_UpArrowShort_Grey_32x42_72.png
          • 1385_Disable_24x24_72.png
          • 1522_stop_waeetch_48x48.png
          • 1522_stop_watch_48ffx48.png
          • 1522_stop_watch_48x48.png
          • 1522_stop_watch_48x481.png
          • 1522_stop_watch_48xdd48.png
          • 1522_stop_watddch_48x48.png
          • 1532_Flag_system_Blue.png
          • 1532_Flag_system_Green.png
          • 1532_Flag_system_Purple.png
          • 1532_Flag_system_red.png
          • 1532_Flag_system_yellow.png
          • 1683_Lightbulb_32x32.png
          • 1683_Lightbulb_32x321.png
          • 16z.png
          • 305_Close_32x42_72.png
          • 30c.png
          • 30d.png
          • 33w.png
          • 33w1.png
          • 34z.png
          • 46e.png
          • 46e1.png
          • 5347.png
          • anaglyph.ico
          • animal1.png
          • animal2.png
          • animal3.png
          • animal4.png
          • animation1.gif
          • animation2.gif
          • Annotation_New.png
          • backl.jpg
          • backr.jpg
          • base_floppgydisk_32.png
          • base_floppydisgk_32.png
          • base_floppydisk_32.png
          • base_floppydisk_321.png
          • base_floppydisk_gj32.png
          • base_speaker_32.png
          • base_star_32.png
          • base_text.png
          • bird1.png
          • bird2.png
          • boat1.png
          • boldhs.png
          • Camera.png
          • Camera1.png
          • Camerah.png
          • Camerhgja.png
          • ChooseColor.png
          • clocgk.png
          • clock.png
          • clock1.png
          • clockhjl.png
          • clockk.png
          • cloud1.png
          • cloud2.png
          • cloud3.png
          • cloud4.png
          • ColorHS.png
          • cp.PNG
          • DataContainer_MoveNextHS.png
          • delete.png
          • Delete_black_32x32.png
          • emd.png
          • FavoriteStar_FrontFacing_32x32_72.png
          • fb.PNG
          • fish1.png
          • FloppyDisk.png
          • flower1.png
          • flower2.png
          • flower3.png
          • flower4.png
          • flower5.png
          • Folder.png
          • FormRunHS.png
          • glassekks.png
          • glasses.png
          • glasseus.png
          • GoToPreviousMessage.png
          • ground1.JPG
          • ground2.JPG
          • history.png
          • human1.png
          • ItalicHS.png
          • kavir.jpg
          • Key.png
          • Key_Right.png
          • m2.png
          • Music_Note_Double_48.png
          • Music_Note_Single_48.png
          • openHS.png
          • PieChart3DHS.png
          • PieChartHS.png
          • RepeatHS.png
          • RightArrow2HS.png
          • RightArrowHS.png
          • rock1.png
          • rock2.png
          • rock3.png
          • rock4.png
          • rock5.png
          • SaveAllHS.png
          • SecurityLock.png
          • ship1.png
          • ship2.png
          • sky1.jpg
          • sky2.jpg
          • skynight.png
          • smartmedia.png
          • snow1.png
          • tree1.png
          • tree2.png
          • water1.png
          • water2.jpg
          • water3.jpg
          • water4.jpg
          • white.png
          • winter.png
  • Anaglyph_demo4.zip
    • 3D
      • IMG_069dd5.JPG
      • IMG_073d7.JPG
      • Ships
        • 36.png
        • 73.png
        • 88.png
        • Nature-136.png
        • Noorderlicht,-Spitzberg,-Norway.png
        • submarine2.png
      • Snow
        • snow0.png
        • snow2.png
        • snow3.png
        • snow4.png
        • snow5.png
      • Trees
        • cadyou.com_Autumn Tree.png
        • Eucalyptus.png
        • Greenhouse-Palm-acai01.png
        • Jacaranda.png
        • Palm-arecaceae.png
        • Sophora.png
        • Thumbs.db
        • tree336.png
      • Water
        • 25912.jpg
        • 77.jpg
        • Cabo San Lucas, Mexico.jpg
        • Carlsbad, California.jpg
        • Nature-100.jpg
        • Newport Beach, California.jpg
        • Victoria Beach, Laguna Beach, California.jpg
        • water1.jpg
  • Anaglyph_demo2.zip
    • Animals
      • animal30.png
      • Animals-135.png
      • Animals-159.png
      • bird-uid-1075390.png
      • bird-uid-1077009.png
      • Blacktail-Deer.png
      • Creatures-uid-1013075.png
      • dog-uid-1080734.png
      • flying-eagle-uid-1076271.png
      • IMG_0777.png
      • Just-a-Sip,-Impala.png
      • Large-black-dog-sitting.png
      • Masai-Giraffe,-Masai-Mara,-Kenya.png
      • Morning-Howl,-Howling-Wolf.png
      • Red_breasted_Robin_1024.png
      • seagull-on-a-post-uid-1080705.png
      • Spotted-Reflections-at-the-Watering-Hole,-Leopard,-Africa.png
      • The-Lookout,-Leopard.png
      • Thumbs.db
      • Birds
        • bird-uid-1077229.png
        • bird-uid-1077233.png
        • flying-eagle-uid-1076267.png
        • Goose_flying.gif
        • Thumbs.db
      • Clouds
        • 25vc.png
        • 39.png
        • 89.png
        • Champagne-Pool,-Waiotapu-Thermal-Area,-North-Island,-New-Zealand.png
        • Chia-Da-Range,-Tibet.png
        • Columbus-Skyline,-Ohio.png
        • Drifters.png
        • Edith-Lake,-Jasper-National-Park,-Canada.png
        • Exploring-the-Crystal-Clear-Water.png
        • God's-Rays.png
        • Grand-Sable-Dunes,-Michigan.png
        • Heart-of-Polynesia,-Cook-Islands.png
        • Island-of-Tahaa,-French-Polynesia.png
        • Painted-Hills,-Oregon.png
        • Peaceful-Formations,-Ocean-Beach,-Californi2a.png
        • Peaceful-Formations,-Ocean-Beach,-California.png
        • Rapeseed-Field,-Idaho.png
        • Tahiti,-French-hhPolynesia.png
        • Tahiti,-French-Polynesia.png
        • Taro-Fields-of-Hanalei,-Kauai.png
      • Fishes
        • A-Whale-of-a-Tail.png
        • dolphin06.png
        • Dolphin1.png
        • shark1.png
      • Flowers
        • 31ed164f37501f53db60bbf1cd855b28[1].png
        • Chicory-flower-L1.png
        • flower1.png
        • flower5.png
        • hd.png
        • leaf-31.png
        • Northern-Geranium,-Alaska.png
        • Orange-Hibiscus.png
        • Orchids-of-the-World-0062.png
        • plantstalk-uid-1111070.png
        • Pressed-wildflower-L6.png
        • Thumbs.db
        • Vinca.png
        • Water-Lily01.png
        • Wild-Rose-Against-a-Red-Pine,-Canada.png
      • Ground
        • dfr.jpg
        • DSC03495.JPG
        • DSC03499.JPG
        • DSC03787.JPG
        • Thumbs.db
      • Misc
        • Arash.png
        • bolbol.png
        • BUTERFLY.png
        • cro.png
        • F22.png
        • home.png
        • IMG_3589.png
        • kavir.png
        • moon.png
        • Prehistoric-World-0059.png
        • propeller-7.png
        • snail.png
        • snowman.png
        • sun.png
        • swan.png
      • Sky
        • 46.jpg
        • 47.jpg
        • Clouds-149.png
        • Cumulus-clouds-4.png
        • Eternal Sky.jpg
        • Masai Mara Game Reserve, Kenya.jpg
        • Nature-144.jpg
        • Vegetation.jpg
  • Anaglyph_demo3.zip
    • Humans
      • DSC03448.png
      • DSC03511.png
      • DSC03515.png
      • DSC03794.png
      • IMG_0178.png
      • IMG_0205.png
      • IMG_0778.png
      • IMG_0813.png
      • IMG_1467.png
      • IMG_1532.png
      • IMG_1535.png
      • IMG_4022.png
      • IMG_4212.png
      • IMG_4243.png
      • IMG_4665.png
      • IMG_4665x.png
      • Rocks
        • 0207_vietnam.png
        • 0607_thai_4.png
        • 6.png
        • 62.png
        • 64.png
        • 78.png
        • 89.png
        • 91.png
        • 97.png
        • Aerial-View,-Mount-McKinley,-Alaska.png
        • Alpenglow-on-Peak-Chugach-Mouggntains,-Alaska.png
        • Alpenglow-on-Peak-Chugach-Mountains,-Alaska.png
        • Bachsee,-Wetterhorn,-Schreckhorn,-Switzerland.png
        • Besso,-Ober-Gablethorn,-and-Matterhorn,-Switzerland.png
        • MountCookNewZealand.png
        • Mt.png
        • Natural-Beauty,-Banff-National-Park,-Alberta,-Canada.png
        • Prusik-Peak-and-Gnome-Tarn,-Alpine-Lakes-Wilderness,-Washington.png
        • rockdd4.png
        • San-Juan-Mountains,-Colorado.png
        • Teton-Barn,-Antelope-Flats,-Jackson-Hole,-Wyoming.png
        • Top-Class-Mountains-(17).png
        • Top-Class-Mountains-(2).png
        • Torres-Del-Paine-National-Park,-Chile.png
        • Wallpaper-1080p-(64).png
        • Wind-Shear,-Matterhorn,-Switzerland.png
  • Anaglyph_demo1e.zip
  • Anaglyph_demo1-noexe.zip
    • Anaglyph.exe.config
    • Anaglyph.vshost.exe.config
    • Anaglyph.vshost.exe.manifest
    • 36.png
    • 73.png
    • 88.png
    • Nature-136.png
    • Noorderlicht,-Spitzberg,-Norway.png
    • submarine2.png
    • snow0.png
    • snow2.png
    • snow3.png
    • snow4.png
    • snow5.png
    • cadyou.com_Autumn Tree.png
    • Eucalyptus.png
    • Greenhouse-Palm-acai01.png
    • Jacaranda.png
    • Palm-arecaceae.png
    • Sophora.png
    • Thumbs.db
    • tree336.png
    • 25912.jpg
    • 77.jpg
    • Cabo San Lucas, Mexico.jpg
    • Carlsbad, California.jpg
    • Nature-100.jpg
    • Newport Beach, California.jpg
    • Victoria Beach, Laguna Beach, California.jpg
    • water1.jpg
  • Anaglyph_demo1.zip
    • Anaglyph.exe
    • Anaglyph.exe.config
    • Anaglyph.pdb
    • Anaglyph.vshost.exe
    • Anaglyph.vshost.exe.config
    • Anaglyph.vshost.exe.manifest
    • 36.png
    • 73.png
    • 88.png
    • Nature-136.png
    • Noorderlicht,-Spitzberg,-Norway.png
    • submarine2.png
    • snow0.png
    • snow2.png
    • snow3.png
    • snow4.png
    • snow5.png
    • cadyou.com_Autumn Tree.png
    • Eucalyptus.png
    • Greenhouse-Palm-acai01.png
    • Jacaranda.png
    • Palm-arecaceae.png
    • Sophora.png
    • Thumbs.db
    • tree336.png
    • 25912.jpg
    • 77.jpg
    • Cabo San Lucas, Mexico.jpg
    • Carlsbad, California.jpg
    • Nature-100.jpg
    • Newport Beach, California.jpg
    • Victoria Beach, Laguna Beach, California.jpg
    • water1.jpg
  • Anaglyph_src2.zip
    • Anaglyph.sln
    • Anaglyph.suo
    • Anaglyph.csproj
    • app.config
    • 3D
      • bird-uid-1077009.png
      • dog-uid-1080734.png
      • flying-eagle-uid-1076271.png
      • Red_breasted_Robin_1024.png
      • Spotted-Reflections-at-the-Watering-Hole,-Leopard,-Africa.png
      • Thumbs.db
      • bird-uid-1077229.png
      • flying-eagle-uid-1076267.png
      • Thumbs.db
      • 25vc.png
      • Peaceful-Formations,-Ocean-Beach,-Californi2a.png
      • Tahiti,-French-hhPolynesia.png
      • A-Whale-of-a-Tail.png
      • dolphin06.png
      • Dolphin1.png
      • shark1.png
      • Orange-Hibiscus.png
      • plantstalk-uid-1111070.png
      • Pressed-wildflower-L6.png
      • Thumbs.db
      • Thumbs.db
      • Humans
        • BUTERFLY.png
        • F22.png
        • sun.png
        • 0207_vietnam.png
        • 78.png
        • rockdd4.png
        • 73.png
        • Sky
          • snow0.png
          • snow2.png
          • snow3.png
          • snow4.png
          • snow5.png
          • Thumbs.db
          • Water
        • clsData.cs
        • frmAbout.cs
        • frmAbout.designer.cs
        • frmAbout.resx
        • frmEdit.cs
        • frmEdit.Designer.cs
        • frmEdit.resx
        • frmEditObjects.cs
        • frmEditObjects.Designer.cs
        • frmEditObjects.resx
        • frmEditOver.cs
        • frmEditOver.Designer.cs
        • frmEditOver.resx
        • frmGlasses.cs
        • frmGlasses.Designer.cs
        • frmGlasses.resx
        • frmMain.cs
        • frmMain.designer.cs
        • frmMain.resx
        • frmObject.cs
        • frmObject.designer.cs
        • frmObject.resx
        • frmSelection.cs
        • frmSelection.designer.cs
        • frmSelection.resx
        • obj
          • x86
        • Program.cs
        • AssemblyInfo.cs
        • Resources.Designer.cs
        • Resources.resx
        • Settings.Designer.cs
        • Settings.settings
        • _3D_farsian.JPG
        • _3D_galikesh.JPG
        • _3D_kavir.jpg
        • 008_Reminder_32x42_72.png
        • 009_HighPriority_48x48_72.png
        • 009_HighPriority_48x48_721.png
        • 010_LowPriority_32x32_72.png
        • 037_Colorize_32x32_72.png
        • 05dx.png
        • 05x.png
        • 0710.png
        • 109_AllAnnotations_Complete_32x42_72.png
        • 109_AllAnnotations_Default_32x42_72.png
        • 109_AllAnnotations_Default_32x42_721.png
        • 109_AllAnnotations_Error_32x42_72.png
        • 109_AllAnnotations_Error_32x42_721.png
        • 109_AllAnnotations_Help_32x42_72.png
        • 109_AllAnnotations_Help_32x42_721.png
        • 109_AllAnnotations_Info_32x42_72.png
        • 109_AllAnnotations_Info_32x42_721.png
        • 109_AllAnnotations_Warning_32x42_72.png
        • 109_AllAnnotations_Warning_32x42_721.png
        • 112_ArrowCurve_Blue_Left_32x42_72.png
        • 112_DownArrowLong_Orange_32x42_72.png
        • 112_DownArrowShort_Blue_32x42_72.png
        • 112_DownArrowShort_Grey_32x42_72.png
        • 112_DownArrowShort_Grey_32x42_721.png
        • 112_DownArrowShort_Orange_32x42_72.png
        • 112_LeftArrowShort_Blue_32x42_72.png
        • 112_LeftArrowShort_Green_32x42_72.png
        • 112_LeftArrowShort_Green_32x42_721.png
        • 112_LeftArrowShort_Grey_32x42_72.png
        • 112_LeftArrowShort_Grey_32x42_721.png
        • 112_LeftArrowShort_Orange_32x42_72.png
        • 112_LeftArrowShort_Orange_32x42_721.png
        • 112_Minus_Grey_32x42_72.png
        • 112_Minus_Grey_32x42_721.png
        • 112_Minus_Orange_32x42_72.png
        • 112_Plus_Blue_32x42_72.png
        • 112_Plus_Green_32x42_72.png
        • 112_Plus_Orange_32x42_72.png
        • 112_RefreshArrow_Blue_32x32.png
        • 112_RefreshArrow_Green_48x48_72.png
        • 112_RightArrowLong_Blue_32x42_72.png
        • 112_RightArrowLong_Green_32x42_72.png
        • 112_RightArrowLong_Grey_32x42_72.png
        • 112_RightArrowLong_Orange_32x42_72.png
        • 112_RightArrowShort_Green_32x42_72.png
        • 112_Tick_Blue_32x32_72.png
        • 112_Tick_Green_32x32_72.png
        • 112_Tick_Green_64x64_72.png
        • 112_Tick_Grey_32x32_72.png
        • 112_Tick_Orange_32x32_72.png
        • 112_UpArrowLong_Blue_32x42_72.png
        • 112_UpArrowLong_Green_32x42_72.png
        • 112_UpArrowLong_Orange_32x42_72.png
        • 112_UpArrowShort_Blue_32x42_72.png
        • 112_UpArrowShort_Green_32x42_72.png
        • 112_UpArrowShort_Grey_32x42_72.png
        • 1385_Disable_24x24_72.png
        • 1522_stop_waeetch_48x48.png
        • 1522_stop_watch_48ffx48.png
        • 1522_stop_watch_48x48.png
        • 1522_stop_watch_48x481.png
        • 1522_stop_watch_48xdd48.png
        • 1522_stop_watddch_48x48.png
        • 1532_Flag_system_Blue.png
        • 1532_Flag_system_Green.png
        • 1532_Flag_system_Purple.png
        • 1532_Flag_system_red.png
        • 1532_Flag_system_yellow.png
        • 1683_Lightbulb_32x32.png
        • 1683_Lightbulb_32x321.png
        • 16z.png
        • 305_Close_32x42_72.png
        • 30c.png
        • 30d.png
        • 33w.png
        • 33w1.png
        • 34z.png
        • 46e.png
        • 46e1.png
        • 5347.png
        • anaglyph.ico
        • animal1.png
        • animal2.png
        • animal3.png
        • animal4.png
        • Annotation_New.png
        • backl.jpg
        • backr.jpg
        • base_floppgydisk_32.png
        • base_floppydisgk_32.png
        • base_floppydisk_32.png
        • base_floppydisk_321.png
        • base_floppydisk_gj32.png
        • base_speaker_32.png
        • base_star_32.png
        • bird1.png
        • bird2.png
        • boat1.png
        • Camera.png
        • Camera1.png
        • Camerah.png
        • Camerhgja.png
        • clocgk.png
        • clock.png
        • clock1.png
        • clockhjl.png
        • clockk.png
        • cloud1.png
        • cloud2.png
        • cloud3.png
        • cloud4.png
        • cp.PNG
        • DataContainer_MoveNextHS.png
        • delete.png
        • Delete_black_32x32.png
        • emd.png
        • FavoriteStar_FrontFacing_32x32_72.png
        • fb.PNG
        • fish1.png
        • FloppyDisk.png
        • flower1.png
        • flower2.png
        • flower3.png
        • flower4.png
        • flower5.png
        • Folder.png
        • FormRunHS.png
        • glassekks.png
        • glasses.png
        • glasseus.png
        • GoToPreviousMessage.png
        • ground1.JPG
        • ground2.JPG
        • history.png
        • human1.png
        • kavir.jpg
        • Key.png
        • Key_Right.png
        • m2.png
        • Music_Note_Double_48.png
        • Music_Note_Single_48.png
        • openHS.png
        • RepeatHS.png
        • RightArrow2HS.png
        • RightArrowHS.png
        • rock1.png
        • rock2.png
        • rock3.png
        • rock4.png
        • rock5.png
        • SaveAllHS.png
        • SecurityLock.png
        • ship1.png
        • ship2.png
        • sky1.jpg
        • sky2.jpg
        • skynight.png
        • smartmedia.png
        • snow1.png
        • tree1.png
        • tree2.png
        • water1.png
        • water2.jpg
        • water3.jpg
        • water4.jpg
        • white.png
        • winter.png
  • Anaglyph_src3.zip
    • Anaglyph.sln
    • Anaglyph.suo
    • Anaglyph.csproj
    • app.config
    • bird-uid-1077009.png
    • dog-uid-1080734.png
    • flying-eagle-uid-1076271.png
    • Red_breasted_Robin_1024.png
    • Spotted-Reflections-at-the-Watering-Hole,-Leopard,-Africa.png
    • Thumbs.db
    • bird-uid-1077229.png
    • flying-eagle-uid-1076267.png
    • Thumbs.db
    • 25vc.png
    • Peaceful-Formations,-Ocean-Beach,-Californi2a.png
    • Tahiti,-French-hhPolynesia.png
    • A-Whale-of-a-Tail.png
    • dolphin06.png
    • Dolphin1.png
    • shark1.png
    • Orange-Hibiscus.png
    • plantstalk-uid-1111070.png
    • Pressed-wildflower-L6.png
    • Thumbs.db
    • Thumbs.db
    • BUTERFLY.png
    • F22.png
    • sun.png
    • 0207_vietnam.png
    • 78.png
    • rockdd4.png
    • 73.png
    • snow0.png
    • snow2.png
    • snow3.png
    • snow4.png
    • snow5.png
    • Thumbs.db
    • clsData.cs
    • frmAbout.cs
    • frmAbout.designer.cs
    • frmAbout.resx
    • frmEdit.cs
    • frmEdit.Designer.cs
    • frmEdit.resx
    • frmEditObjects.cs
    • frmEditObjects.Designer.cs
    • frmEditObjects.resx
    • frmEditOver.cs
    • frmEditOver.Designer.cs
    • frmEditOver.resx
    • frmGlasses.cs
    • frmGlasses.Designer.cs
    • frmGlasses.resx
    • frmMain.cs
    • frmMain.designer.cs
    • frmMain.resx
    • frmObject.cs
    • frmObject.designer.cs
    • frmObject.resx
    • frmSelection.cs
    • frmSelection.designer.cs
    • frmSelection.resx
    • Program.cs
    • AssemblyInfo.cs
    • Resources.Designer.cs
    • Resources.resx
    • Settings.Designer.cs
    • Settings.settings
    • _3D_farsian.JPG
    • _3D_galikesh.JPG
    • _3D_kavir.jpg
    • 008_Reminder_32x42_72.png
    • 009_HighPriority_48x48_72.png
    • 009_HighPriority_48x48_721.png
    • 010_LowPriority_32x32_72.png
    • 037_Colorize_32x32_72.png
    • 05dx.png
    • 05x.png
    • 0710.png
    • 109_AllAnnotations_Complete_32x42_72.png
    • 109_AllAnnotations_Default_32x42_72.png
    • 109_AllAnnotations_Default_32x42_721.png
    • 109_AllAnnotations_Error_32x42_72.png
    • 109_AllAnnotations_Error_32x42_721.png
    • 109_AllAnnotations_Help_32x42_72.png
    • 109_AllAnnotations_Help_32x42_721.png
    • 109_AllAnnotations_Info_32x42_72.png
    • 109_AllAnnotations_Info_32x42_721.png
    • 109_AllAnnotations_Warning_32x42_72.png
    • 109_AllAnnotations_Warning_32x42_721.png
    • 112_ArrowCurve_Blue_Left_32x42_72.png
    • 112_DownArrowLong_Orange_32x42_72.png
    • 112_DownArrowShort_Blue_32x42_72.png
    • 112_DownArrowShort_Grey_32x42_72.png
    • 112_DownArrowShort_Grey_32x42_721.png
    • 112_DownArrowShort_Orange_32x42_72.png
    • 112_LeftArrowShort_Blue_32x42_72.png
    • 112_LeftArrowShort_Green_32x42_72.png
    • 112_LeftArrowShort_Green_32x42_721.png
    • 112_LeftArrowShort_Grey_32x42_72.png
    • 112_LeftArrowShort_Grey_32x42_721.png
    • 112_LeftArrowShort_Orange_32x42_72.png
    • 112_LeftArrowShort_Orange_32x42_721.png
    • 112_Minus_Grey_32x42_72.png
    • 112_Minus_Grey_32x42_721.png
    • 112_Minus_Orange_32x42_72.png
    • 112_Plus_Blue_32x42_72.png
    • 112_Plus_Green_32x42_72.png
    • 112_Plus_Orange_32x42_72.png
    • 112_RefreshArrow_Blue_32x32.png
    • 112_RefreshArrow_Green_48x48_72.png
    • 112_RightArrowLong_Blue_32x42_72.png
    • 112_RightArrowLong_Green_32x42_72.png
    • 112_RightArrowLong_Grey_32x42_72.png
    • 112_RightArrowLong_Orange_32x42_72.png
    • 112_RightArrowShort_Green_32x42_72.png
    • 112_Tick_Blue_32x32_72.png
    • 112_Tick_Green_32x32_72.png
    • 112_Tick_Green_64x64_72.png
    • 112_Tick_Grey_32x32_72.png
    • 112_Tick_Orange_32x32_72.png
    • 112_UpArrowLong_Blue_32x42_72.png
    • 112_UpArrowLong_Green_32x42_72.png
    • 112_UpArrowLong_Orange_32x42_72.png
    • 112_UpArrowShort_Blue_32x42_72.png
    • 112_UpArrowShort_Green_32x42_72.png
    • 112_UpArrowShort_Grey_32x42_72.png
    • 1385_Disable_24x24_72.png
    • 1522_stop_waeetch_48x48.png
    • 1522_stop_watch_48ffx48.png
    • 1522_stop_watch_48x48.png
    • 1522_stop_watch_48x481.png
    • 1522_stop_watch_48xdd48.png
    • 1522_stop_watddch_48x48.png
    • 1532_Flag_system_Blue.png
    • 1532_Flag_system_Green.png
    • 1532_Flag_system_Purple.png
    • 1532_Flag_system_red.png
    • 1532_Flag_system_yellow.png
    • 1683_Lightbulb_32x32.png
    • 1683_Lightbulb_32x321.png
    • 16z.png
    • 305_Close_32x42_72.png
    • 30c.png
    • 30d.png
    • 33w.png
    • 33w1.png
    • 34z.png
    • 46e.png
    • 46e1.png
    • 5347.png
    • anaglyph.ico
    • animal1.png
    • animal2.png
    • animal3.png
    • animal4.png
    • Annotation_New.png
    • backl.jpg
    • backr.jpg
    • base_floppgydisk_32.png
    • base_floppydisgk_32.png
    • base_floppydisk_32.png
    • base_floppydisk_321.png
    • base_floppydisk_gj32.png
    • base_speaker_32.png
    • base_star_32.png
    • base_text.png
    • bird1.png
    • bird2.png
    • boat1.png
    • Camera.png
    • Camera1.png
    • Camerah.png
    • Camerhgja.png
    • clocgk.png
    • clock.png
    • clock1.png
    • clockhjl.png
    • clockk.png
    • cloud1.png
    • cloud2.png
    • cloud3.png
    • cloud4.png
    • cp.PNG
    • DataContainer_MoveNextHS.png
    • delete.png
    • Delete_black_32x32.png
    • emd.png
    • FavoriteStar_FrontFacing_32x32_72.png
    • fb.PNG
    • fish1.png
    • FloppyDisk.png
    • flower1.png
    • flower2.png
    • flower3.png
    • flower4.png
    • flower5.png
    • Folder.png
    • FormRunHS.png
    • glassekks.png
    • glasses.png
    • glasseus.png
    • GoToPreviousMessage.png
    • ground1.JPG
    • ground2.JPG
    • history.png
    • human1.png
    • kavir.jpg
    • Key.png
    • Key_Right.png
    • m2.png
    • Music_Note_Double_48.png
    • Music_Note_Single_48.png
    • openHS.png
    • RepeatHS.png
    • RightArrow2HS.png
    • RightArrowHS.png
    • rock1.png
    • rock2.png
    • rock3.png
    • rock4.png
    • rock5.png
    • SaveAllHS.png
    • SecurityLock.png
    • ship1.png
    • ship2.png
    • sky1.jpg
    • sky2.jpg
    • skynight.png
    • smartmedia.png
    • snow1.png
    • tree1.png
    • tree2.png
    • water1.png
    • water2.jpg
    • water3.jpg
    • water4.jpg
    • white.png
    • winter.png
  • Anaglyph_src.zip
    • Anaglyph.sln
    • Anaglyph.suo
    • Anaglyph.csproj
    • app.config
    • bird-uid-1077009.png
    • dog-uid-1080734.png
    • flying-eagle-uid-1076271.png
    • Red_breasted_Robin_1024.png
    • Spotted-Reflections-at-the-Watering-Hole,-Leopard,-Africa.png
    • Thumbs.db
    • bird-uid-1077229.png
    • flying-eagle-uid-1076267.png
    • Thumbs.db
    • 25vc.png
    • Peaceful-Formations,-Ocean-Beach,-Californi2a.png
    • Tahiti,-French-hhPolynesia.png
    • A-Whale-of-a-Tail.png
    • dolphin06.png
    • Dolphin1.png
    • shark1.png
    • Orange-Hibiscus.png
    • plantstalk-uid-1111070.png
    • Pressed-wildflower-L6.png
    • Thumbs.db
    • Thumbs.db
    • BUTERFLY.png
    • F22.png
    • sun.png
    • 0207_vietnam.png
    • 78.png
    • rockdd4.png
    • 73.png
    • snow0.png
    • snow2.png
    • snow3.png
    • snow4.png
    • snow5.png
    • Thumbs.db
    • clsData.cs
    • frmAbout.cs
    • frmAbout.designer.cs
    • frmAbout.resx
    • frmEdit.cs
    • frmEdit.Designer.cs
    • frmEdit.resx
    • frmEditObjects.cs
    • frmEditObjects.Designer.cs
    • frmEditObjects.resx
    • frmEditOver.cs
    • frmEditOver.Designer.cs
    • frmEditOver.resx
    • frmMain.cs
    • frmMain.designer.cs
    • frmMain.resx
    • frmObject.cs
    • frmObject.designer.cs
    • frmObject.resx
    • frmSelection.cs
    • frmSelection.designer.cs
    • frmSelection.resx
    • Program.cs
    • AssemblyInfo.cs
    • Resources.Designer.cs
    • Resources.resx
    • Settings.Designer.cs
    • Settings.settings
    • 008_Reminder_32x42_72.png
    • 009_HighPriority_48x48_72.png
    • 009_HighPriority_48x48_721.png
    • 010_LowPriority_32x32_72.png
    • 037_Colorize_32x32_72.png
    • 05dx.png
    • 05x.png
    • 109_AllAnnotations_Complete_32x42_72.png
    • 109_AllAnnotations_Default_32x42_72.png
    • 109_AllAnnotations_Default_32x42_721.png
    • 109_AllAnnotations_Error_32x42_72.png
    • 109_AllAnnotations_Error_32x42_721.png
    • 109_AllAnnotations_Help_32x42_72.png
    • 109_AllAnnotations_Help_32x42_721.png
    • 109_AllAnnotations_Info_32x42_72.png
    • 109_AllAnnotations_Info_32x42_721.png
    • 109_AllAnnotations_Warning_32x42_72.png
    • 109_AllAnnotations_Warning_32x42_721.png
    • 112_ArrowCurve_Blue_Left_32x42_72.png
    • 112_DownArrowLong_Orange_32x42_72.png
    • 112_DownArrowShort_Blue_32x42_72.png
    • 112_DownArrowShort_Grey_32x42_72.png
    • 112_DownArrowShort_Grey_32x42_721.png
    • 112_DownArrowShort_Orange_32x42_72.png
    • 112_LeftArrowShort_Blue_32x42_72.png
    • 112_LeftArrowShort_Green_32x42_72.png
    • 112_LeftArrowShort_Green_32x42_721.png
    • 112_LeftArrowShort_Grey_32x42_72.png
    • 112_LeftArrowShort_Grey_32x42_721.png
    • 112_LeftArrowShort_Orange_32x42_72.png
    • 112_LeftArrowShort_Orange_32x42_721.png
    • 112_Minus_Grey_32x42_72.png
    • 112_Minus_Grey_32x42_721.png
    • 112_Minus_Orange_32x42_72.png
    • 112_Plus_Blue_32x42_72.png
    • 112_Plus_Green_32x42_72.png
    • 112_Plus_Orange_32x42_72.png
    • 112_RefreshArrow_Blue_32x32.png
    • 112_RefreshArrow_Green_48x48_72.png
    • 112_RightArrowLong_Blue_32x42_72.png
    • 112_RightArrowLong_Green_32x42_72.png
    • 112_RightArrowLong_Grey_32x42_72.png
    • 112_RightArrowLong_Orange_32x42_72.png
    • 112_RightArrowShort_Green_32x42_72.png
    • 112_Tick_Blue_32x32_72.png
    • 112_Tick_Green_32x32_72.png
    • 112_Tick_Green_64x64_72.png
    • 112_Tick_Grey_32x32_72.png
    • 112_Tick_Orange_32x32_72.png
    • 112_UpArrowLong_Blue_32x42_72.png
    • 112_UpArrowLong_Green_32x42_72.png
    • 112_UpArrowLong_Orange_32x42_72.png
    • 112_UpArrowShort_Blue_32x42_72.png
    • 112_UpArrowShort_Green_32x42_72.png
    • 112_UpArrowShort_Grey_32x42_72.png
    • 1385_Disable_24x24_72.png
    • 1522_stop_waeetch_48x48.png
    • 1522_stop_watch_48ffx48.png
    • 1522_stop_watch_48x48.png
    • 1522_stop_watch_48x481.png
    • 1522_stop_watch_48xdd48.png
    • 1522_stop_watddch_48x48.png
    • 1532_Flag_system_Blue.png
    • 1532_Flag_system_Green.png
    • 1532_Flag_system_Purple.png
    • 1532_Flag_system_red.png
    • 1532_Flag_system_yellow.png
    • 1683_Lightbulb_32x32.png
    • 1683_Lightbulb_32x321.png
    • 16z.png
    • 305_Close_32x42_72.png
    • 30c.png
    • 30d.png
    • 33w.png
    • 33w1.png
    • 34z.png
    • 46e.png
    • 46e1.png
    • anaglyph.ico
    • animal1.png
    • animal2.png
    • animal3.png
    • animal4.png
    • Annotation_New.png
    • backl.jpg
    • backr.jpg
    • base_floppgydisk_32.png
    • base_floppydisgk_32.png
    • base_floppydisk_32.png
    • base_floppydisk_321.png
    • base_floppydisk_gj32.png
    • base_speaker_32.png
    • base_star_32.png
    • bird1.png
    • bird2.png
    • boat1.png
    • Camera.png
    • Camera1.png
    • Camerah.png
    • Camerhgja.png
    • clocgk.png
    • clock.png
    • clock1.png
    • clockhjl.png
    • clockk.png
    • cloud1.png
    • cloud2.png
    • cloud3.png
    • cloud4.png
    • DataContainer_MoveNextHS.png
    • delete.png
    • Delete_black_32x32.png
    • emd.png
    • FavoriteStar_FrontFacing_32x32_72.png
    • fb.PNG
    • fish1.png
    • FloppyDisk.png
    • flower1.png
    • flower2.png
    • flower3.png
    • flower4.png
    • flower5.png
    • FormRunHS.png
    • glassekks.png
    • glasses.png
    • glasseus.png
    • GoToPreviousMessage.png
    • ground1.JPG
    • ground2.JPG
    • history.png
    • human1.png
    • kavir.jpg
    • Key.png
    • Key_Right.png
    • m2.png
    • Music_Note_Double_48.png
    • Music_Note_Single_48.png
    • RepeatHS.png
    • RightArrow2HS.png
    • RightArrowHS.png
    • rock1.png
    • rock2.png
    • rock3.png
    • rock4.png
    • rock5.png
    • SaveAllHS.png
    • SecurityLock.png
    • ship1.png
    • ship2.png
    • sky1.jpg
    • sky2.jpg
    • skynight.png
    • smartmedia.png
    • snow1.png
    • tree1.png
    • tree2.png
    • water1.png
    • water2.jpg
    • water3.jpg
    • water4.jpg
    • winter.png
  • Anaglyph_demo1e-noexe.zip
  • Anaglyph_demo1z.zip
  • Anaglyph_demo1z-noexe.zip
  • Anaglyph_demo1x.zip
  • Anaglyph_demo1x-noexe.zip
��using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.IO;

using System.Drawing.Imaging;

using System.Diagnostics;



// Note: some parts of code are from 2009 and some parts 2013 - so maybe it is a little messy



namespace Anaglyph

{

    public partial class frmMain : Form

    {



        #region Variable definition



        private List<string> imageTypes = new List<string>(new string[] { "*.jpg", "*.png", "*.gif", "*.bmp" });



        private List<Image>[] picsAll = new List<Image>[] { new List<Image>(), new List<Image>(),

            new List<Image>() , new List<Image>(), new List<Image>(), new List<Image>(),

            new List<Image>() , new List<Image>(), new List<Image>(), new List<Image>(), 

            new List<Image>() , new List<Image>(), new List<Image>(), new List<Image>(), 

            new List<Image>(), new List<Image>(), new List<Image>(), new List<Image>() };



        private picCollection myPicInfo;

        private List<picCollection> myAllPicCollection = new List<picCollection>();





        private List<frmObject> mySnowCollection = new List<frmObject>();

        private List<ToolStripItem> myMenuItemCollection = new List<ToolStripItem>();



        private Bitmap rightBitmap, leftBitmap, bmpAnaglyph, redBitmap, cyanBitmap;



        float maxDepth, minDepth, meanDepth;



        StringBuilder stbInfo = new StringBuilder();



        private Random myRandom = new Random();



        private string myTitle = "Anaglyph ";



        private int baseDepth = -100;

        private int baseWidthCorrection = 200;



        float[][][] picMatrix;

        float[][][] anaglyphMatrix;



        int picSkySelected = 0;

        int picGroundSelected = 0;

        int picWaterSelected = 0;

        int picBack3DSelected = 0;





        float myGeneralSize, myAltitude, myViewAngle;

        int myGroundHeight, myBackHeight;

        int myOutputWidth, myOutputHeight, myOutputWidthCorrected;



        int myObjectsOrientation = 0;

        int MyDefaultImageFormat = 1;// 0=jpg, 1=png, 2=gif 



        bool isFullScreen = false;

        int borderTop, borderLeft;

        ToolStripMenuItem myLastGlassesSelected=new ToolStripMenuItem();

        string myGeneralFileName;

        #endregion





        #region Prepare the program - load data from the hard disk



        public frmMain()

        {

            InitializeComponent();

            firstStart();

        }



        private void frmMain_Load(object sender, EventArgs e)

        {

            borderTop = this.Height - pnlBase.Height;

            borderLeft = (this.Width - pnlBase.Width) / 2;



            goRun(false);

        }



        private void firstStart()

        {

            this.Width = Screen.PrimaryScreen.Bounds.Width;

            this.Height = Screen.PrimaryScreen.Bounds.Height;



            setControlsSize();

            loadPictures();

            setMatices();





            cmbGeneralEffect.SelectedIndex = 0;

            picSkySelected = myRandom.Next(2, picsAll[myObjectTypes.Sky.GetHashCode()].Count);

            picSky.BackgroundImage = picsAll[myObjectTypes.Sky.GetHashCode()][picSkySelected];



            picGroundSelected = myRandom.Next(2, picsAll[myObjectTypes.Ground.GetHashCode()].Count);

            picGround.BackgroundImage = picsAll[myObjectTypes.Ground.GetHashCode()][picGroundSelected];



            picWaterSelected = myRandom.Next(1, picsAll[myObjectTypes.Water.GetHashCode()].Count);

            picWater.BackgroundImage = picsAll[myObjectTypes.Water.GetHashCode()][picWaterSelected];



            picBack3DSelected = myRandom.Next(picsAll[myObjectTypes._3D.GetHashCode()].Count);

            picBack3D.BackgroundImage = picsAll[myObjectTypes._3D.GetHashCode()][picBack3DSelected];



            myLastGlassesSelected = mnuGlassesRedCyan;

            tmrNext.Interval = (int)updTimerNext.Value * 1000;



            // add menu items to my collection for random auto run

            foreach (ToolStripItem tsm in mnuPersianGulf.DropDownItems) myMenuItemCollection.Add(tsm);

            foreach (ToolStripItem tsm in mnuGolestanPark.DropDownItems) myMenuItemCollection.Add(tsm);

            foreach (ToolStripItem tsm in mnuSpecialEffect.DropDownItems) myMenuItemCollection.Add(tsm);





            // making "SAVE" directory for saving output images

            try

            {

                DirectoryInfo myDir = new DirectoryInfo(Application.StartupPath + "\\Save\\");

                if (!myDir.Exists) myDir.Create();



                myDir = new DirectoryInfo(Application.StartupPath + "\\Save\\Data\\");

                if (!myDir.Exists) myDir.Create();

            }

            catch (Exception e)

            {

                MessageBox.Show(e.Message);

            }



        }





        // at the start of the program, load some images and shapes

        private void loadPictures()

        {

            // add some pictures from internal resources



            picsAll[myObjectTypes._3D.GetHashCode()].Add(Properties.Resources._3D_farsian);

            picsAll[myObjectTypes._3D.GetHashCode()].Add(Properties.Resources._3D_galikesh);

            picsAll[myObjectTypes._3D.GetHashCode()].Add(Properties.Resources._3D_kavir);



            picsAll[myObjectTypes.Snow.GetHashCode()].Add(Properties.Resources.snow1);



            picsAll[myObjectTypes.Cloud.GetHashCode()].Add(Properties.Resources.cloud1);

            picsAll[myObjectTypes.Cloud.GetHashCode()].Add(Properties.Resources.cloud2);

            picsAll[myObjectTypes.Cloud.GetHashCode()].Add(Properties.Resources.cloud3);

            picsAll[myObjectTypes.Cloud.GetHashCode()].Add(Properties.Resources.cloud4);



            picsAll[myObjectTypes.Ground.GetHashCode()].Add(Properties.Resources.winter);

            picsAll[myObjectTypes.Ground.GetHashCode()].Add(Properties.Resources.kavir);

            picsAll[myObjectTypes.Ground.GetHashCode()].Add(Properties.Resources.ground1);

            picsAll[myObjectTypes.Ground.GetHashCode()].Add(Properties.Resources.ground2);



            picsAll[myObjectTypes.Ship.GetHashCode()].Add(Properties.Resources.boat1);

            picsAll[myObjectTypes.Ship.GetHashCode()].Add(Properties.Resources.ship1);

            picsAll[myObjectTypes.Ship.GetHashCode()].Add(Properties.Resources.ship2);

            picsAll[myObjectTypes.Ship.GetHashCode()].Add(Properties.Resources.ship2);



            picsAll[myObjectTypes.Fish.GetHashCode()].Add(Properties.Resources.fish1);



            picsAll[myObjectTypes.Rock.GetHashCode()].Add(Properties.Resources.rock1);

            picsAll[myObjectTypes.Rock.GetHashCode()].Add(Properties.Resources.rock2);

            picsAll[myObjectTypes.Rock.GetHashCode()].Add(Properties.Resources.rock3);

            picsAll[myObjectTypes.Rock.GetHashCode()].Add(Properties.Resources.rock4);

            picsAll[myObjectTypes.Rock.GetHashCode()].Add(Properties.Resources.rock5);



            picsAll[myObjectTypes.Water.GetHashCode()].Add(Properties.Resources.winter);

            picsAll[myObjectTypes.Water.GetHashCode()].Add(Properties.Resources.water1);

            picsAll[myObjectTypes.Water.GetHashCode()].Add(Properties.Resources.water2);

            picsAll[myObjectTypes.Water.GetHashCode()].Add(Properties.Resources.water3);

            picsAll[myObjectTypes.Water.GetHashCode()].Add(Properties.Resources.water4);

            picsAll[myObjectTypes.Water.GetHashCode()].Add(Properties.Resources.water4);



            picsAll[myObjectTypes.Sky.GetHashCode()].Add(Properties.Resources.winter);

            picsAll[myObjectTypes.Sky.GetHashCode()].Add(Properties.Resources.skynight);

            picsAll[myObjectTypes.Sky.GetHashCode()].Add(Properties.Resources.sky1);

            picsAll[myObjectTypes.Sky.GetHashCode()].Add(Properties.Resources.sky2);



            picsAll[myObjectTypes.Bird.GetHashCode()].Add(Properties.Resources.bird1);

            picsAll[myObjectTypes.Bird.GetHashCode()].Add(Properties.Resources.bird1);

            picsAll[myObjectTypes.Bird.GetHashCode()].Add(Properties.Resources.bird2);



            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower1);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower1);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower2);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower2);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower3);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower4);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower4);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower5);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower5);

            picsAll[myObjectTypes.Flower.GetHashCode()].Add(Properties.Resources.flower5);



            picsAll[myObjectTypes.Tree.GetHashCode()].Add(Properties.Resources.tree1);

            picsAll[myObjectTypes.Tree.GetHashCode()].Add(Properties.Resources.tree2);



            picsAll[myObjectTypes.Human.GetHashCode()].Add(Properties.Resources.human1);



            picsAll[myObjectTypes.Animal.GetHashCode()].Add(Properties.Resources.animal1);

            picsAll[myObjectTypes.Animal.GetHashCode()].Add(Properties.Resources.animal2);

            picsAll[myObjectTypes.Animal.GetHashCode()].Add(Properties.Resources.animal3);

            picsAll[myObjectTypes.Animal.GetHashCode()].Add(Properties.Resources.animal4);



            //load some pictures from Hard disk (different sub directories)

            loadFromHard("Clouds", picsAll[myObjectTypes.Cloud.GetHashCode()], null);

            loadFromHard("Rocks", picsAll[myObjectTypes.Rock.GetHashCode()], null);

            loadFromHard("Birds", picsAll[myObjectTypes.Bird.GetHashCode()], null);

            loadFromHard("Trees", picsAll[myObjectTypes.Tree.GetHashCode()], null);

            loadFromHard("Ships", picsAll[myObjectTypes.Ship.GetHashCode()], null);

            loadFromHard("Fishes", picsAll[myObjectTypes.Fish.GetHashCode()], null);

            loadFromHard("Humans", picsAll[myObjectTypes.Human.GetHashCode()], null);

            loadFromHard("Animals", picsAll[myObjectTypes.Animal.GetHashCode()], null);

            loadFromHard("Flowers", picsAll[myObjectTypes.Flower.GetHashCode()], null);

            loadFromHard("Snow", picsAll[myObjectTypes.Snow.GetHashCode()], null);

            loadFromHard("Ground", picsAll[myObjectTypes.Ground.GetHashCode()], null);

            loadFromHard("Water", picsAll[myObjectTypes.Water.GetHashCode()], null);

            loadFromHard("Sky", picsAll[myObjectTypes.Sky.GetHashCode()], null);

            loadFromHard("Misc", picsAll[myObjectTypes.Misc.GetHashCode()], null);

            loadFromHard("3D", picsAll[myObjectTypes._3D.GetHashCode()], null);



        }



        // load pictures from the hard disk

        private void loadFromHard(string myDir, List<Image> myPicList, List<Image> myPicList2)

        {

            DirectoryInfo myFileDir = new DirectoryInfo(Application.StartupPath + "\\" + myDir);

            if (myFileDir.Exists)

            {

                // For each image extension (.jpg, .bmp, etc.)

                foreach (string imageType in imageTypes)

                {

                    // all graphic files in the directory 

                    foreach (FileInfo myFile in myFileDir.GetFiles(imageType))

                    {

                        // add image

                        try

                        {

                            Image image = Image.FromFile(myFile.FullName);

                            myPicList.Add(image);

                        }

                        catch (OutOfMemoryException)

                        {

                            continue;

                        }

                    }

                }

            }



        }



        #endregion





        #region Color Matrices definition



        //  color matrices 

        private void setMatices()

        {



            float[][] matrixNormal = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };







            float[][] matrixBW = new float[][] {

                new float[] {.34f, .34f, .34f, 0, 0}, //  Red  

                new float[] {.34f, .34f, .34f, 0, 0}, //  Green

                new float[] {.34f, .34f, .34f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            float[][] matrixBW_Contrast = new float[][] {

                new float[] {.4f, .4f,.4f, 0, 0}, //  Red  

                new float[] {.4f, .4f,.4f, 0, 0}, //  Green

                new float[] {.4f, .4f, .4f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            float[][] matrixBW_Contrast_More = new float[][] {

                new float[] {.5f, .5f,.5f, 0, 0}, //  Red  

                new float[] {.5f, .5f,.5f, 0, 0}, //  Green

                new float[] {.5f, .5f, .5f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };





            float[][] matrixBW_Contrast_Most = new float[][] {

                new float[] {.8f, .8f,.8f, 0, 0}, //  Red  

                new float[] {.8f, .8f,.8f, 0, 0}, //  Green

                new float[] {.8f, .8f, .8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            float[][] matrixBW_Brighter = new float[][] {

                new float[] {.34f, .34f, .34f, 0, 0}, //  Red  

                new float[] {.34f, .34f, .34f, 0, 0}, //  Green

                new float[] {.34f, .34f, .34f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.1f, .1f, .1f, 0, 1}

            };



            float[][] matrixBW_Brighter_More = new float[][] {

                new float[] {.35f, .35f, .35f, 0, 0}, //  Red  

                new float[] {.35f, .35f, .35f, 0, 0}, //  Green

                new float[] {.35f, .35f, .35f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.25f, .25f, .25f, 0, 1}

            };





            float[][] matrixBW_Brighter_Most = new float[][] {

                new float[] {.4f, .4f,.4f, 0, 0}, //  Red  

                new float[] {.4f, .4f,.4f, 0, 0}, //  Green

                new float[] {.4f, .4f, .4f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.5f, 0.5f, 0.5f, 0, 1}

            };



            float[][] matrixBW_Darker = new float[][] {

                new float[] {.3f, .3f,.3f, 0, 0}, //  Red  

                new float[] {.3f, .3f,.3f, 0, 0}, //  Green

                new float[] {.3f, .3f, .3f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };





            float[][] matrixBW_Darker_More = new float[][] {

                new float[] {.25f, .25f,.25f, 0, 0}, //  Red  

                new float[] {.25f, .25f,.25f, 0, 0}, //  Green

                new float[] {.25f, .25f, .25f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            float[][] matrixBW_Darker_Most = new float[][] {

                new float[] {.14f, .14f,.14f, 0, 0}, //  Red  

                new float[] {.14f, .14f,.14f, 0, 0}, //  Green

                new float[] {.14f, .14f, .14f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            ////////////////////////////////////////////////////////////////////////////

            float[][] matrixContrast = new float[][] {

                new float[] {1.1f, .1f, .1f, 0, 0}, //  Red  

                new float[] {.1f, 1.1f, .1f, 0, 0}, //  Green

                new float[] {.1f, .1f, 1.1f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixContrast_More = new float[][] {

                new float[] {1.2f, .25f, .25f, 0, 0}, //  Red  

                new float[] {.25f, 1.2f, .25f, 0, 0}, //  Green

                new float[] {.25f, .25f, 1.2f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixContrast_Most = new float[][] {

                new float[] {1.3f, .5f, .5f, 0, 0}, //  Red  

                new float[] {.5f, 1.3f, .5f, 0, 0}, //  Green

                new float[] {.5f, .5f, 1.3f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };





            float[][] matrixContrast_Full = new float[][] {

                 new float[] {2, 1, 1, 0, 0}, //  Red  

                new float[] {1, 2, 1, 0, 0}, //  Green

                new float[] {1, 1, 2, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixBright = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.1f, .1f, .1f, 0, 1}

            };

            float[][] matrixBrightP = new float[][] {

                new float[] {1.05f, .025f, .025f, 0, 0}, //  Red  

                new float[] {.025f, 1.05f, .025f, 0, 0}, //  Green

                new float[] {.025f, .025f, 1.05f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.1f, .1f, .1f, 0, 1}

            };

            float[][] matrixBrighter_More = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.3f, 0.3f, 0.3f, 0, 1}

            };

            float[][] matrixBrighter_MoreP = new float[][] {

                new float[] {1.15f, .1f, 0.1f, 0, 0}, //  Red  

                new float[] {0.1f, 1.15f, 0.1f, 0, 0}, //  Green

                new float[] {0.1f, 0.1f, 1.15f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.3f, 0.3f, 0.3f, 0, 1}

            };



            float[][] matrixBrighter_Most = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.5f, 0.5f, 0.5f, 0, 1}

            };



            float[][] matrixBrighter_MostP = new float[][] {

                new float[] {1.2f, .1f, 0.1f, 0, 0}, //  Red  

                new float[] {0.1f, 1.2f, 0.1f, 0, 0}, //  Green

                new float[] {0.1f, 0.1f, 1.2f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.5f, 0.5f, 0.5f, 0, 1}

            };





            float[][] matrixBright_Full = new float[][] {

                new float[] {1.1f, .05f, .05f, 0, 0}, //  Red  

                new float[] {.05f, 1.1f, .05f, 0, 0}, //  Green

                new float[] {.05f, .05f, 1.1f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.7f, .7f, .7f, 0, 1}

           };



            float[][] matrixBright_FullP = new float[][] {

                new float[] {1.3f, .2f, .2f, 0, 0}, //  Red  

                new float[] {.2f, 1.3f, .2f, 0, 0}, //  Green

                new float[] {.2f, .2f, 1.3f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.8f, .8f, .8f, 0, 1}

           };





            /////////////////////////////////////////////////////////////////////////////////

            float[][] matrixDark = new float[][] {

                new float[] {.9f, -.05f, -.05f, 0, 0}, //  Red  

                new float[] {.05f, .9f, .05f, 0, 0}, //  Green

                new float[] {.05f, .05f, .9f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            float[][] matrixDarkP = new float[][] {

                new float[] {.9f, -.05f, -.05f, 0, 0}, //  Red  

                new float[] {.05f, .9f, .05f, 0, 0}, //  Green

                new float[] {.05f, .05f, .9f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.1f, -.1f, -.1f, 0, 1}

            };



            float[][] matrixDarker_More = new float[][] {

                new float[] {.8f, -.1f, -.1f, 0, 0}, //  Red  

                new float[] {-.1f, .8f, -.1f, 0, 0}, //  Green

                new float[] {-.1f, -.1f, .8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.05f, -.05f, -.05f, 0, 1}

            };



            float[][] matrixDarker_MoreP = new float[][] {

                new float[] {.8f, -.1f, -.1f, 0, 0}, //  Red  

                new float[] {-.1f, .8f, -.1f, 0, 0}, //  Green

                new float[] {-.1f, -.1f, .8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.2f, -.2f, -.2f, 0, 1}

            };



            float[][] matrixDarker_Most = new float[][] {

                new float[] {.7f, -.2f, -.2f, 0, 0}, //  Red  

                new float[] {-.2f, .7f, -.2f, 0, 0}, //  Green

                new float[] {-.2f, -.2f, .7f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.1f, -.1f, -.1f, 0, 1}

            };



            float[][] matrixDarker_MostP = new float[][] {

                new float[] {.7f, -.2f, -.2f, 0, 0}, //  Red  

                new float[] {-.2f, .7f, -.2f, 0, 0}, //  Green

                new float[] {-.2f, -.2f, .7f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.15f, -.15f, -.15f, 0, 1}

            };





            float[][] matrixDarkFull = new float[][] {

               new float[] {.6f, -.4f, -.4f, 0, 0}, //  Red  

                new float[] {-.4f, .6f, -.4f, 0, 0}, //  Green

                new float[] {-.4f, -.4f, .6f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            //////////////////////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixColorize = new float[][] {

                new float[] {1.1f, -.05f, -.05f, 0, 0}, //  Red  

                new float[] {-.05f, 1.1f, -.05f, 0, 0}, //  Green

                new float[] {-.05f, -.05f, 1.1f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorizeP = new float[][] {

                new float[] {1.2f, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1.2f, 0, 0, 0}, //  Green

                new float[] {0, 0, 1.2f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorizeM = new float[][] {

                new float[] {1, -.1f, -.1f, 0, 0}, //  Red  

                new float[] {-.1f, 1, -.1f, 0, 0}, //  Green

                new float[] {-.1f, -.1f, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };





            float[][] matrixColorize_More = new float[][] {

                new float[] {1.3f, -.1f, -.1f, 0, 0}, //  Red  

                new float[] {-.1f, 1.3f, -.1f, 0, 0}, //  Green

                new float[] {-.1f, -.1f, 1.3f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_MoreP = new float[][] {

                new float[] {1.5f, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1.5f, 0, 0, 0}, //  Green

                new float[] {0, 0, 1.5f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_MoreM = new float[][] {

                new float[] {1.1f, -.2f, -.2f, 0, 0}, //  Red  

                new float[] {-.2f, 1.1f, -.2f, 0, 0}, //  Green

                new float[] {-.2f, -.2f, 1.1f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            float[][] matrixColorize_Most = new float[][] {

                new float[] {1.4f, -.2f, -.2f, 0, 0}, //  Red  

                new float[] {-.2f, 1.4f, -.2f, 0, 0}, //  Green

                new float[] {-.2f, -.2f, 1.4f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_MostP = new float[][] {

                new float[] {1.6f, -.1f, -.1f, 0, 0}, //  Red  

                new float[] {-.1f, 1.6f, -.1f, 0, 0}, //  Green

                new float[] {-.1f, -.1f, 1.6f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_MostM = new float[][] {

                new float[] {1.2f, -.3f, -.3f, 0, 0}, //  Red  

                new float[] {-.3f, 1.2f, -.3f, 0, 0}, //  Green

                new float[] {-.3f, -.3f, 1.2f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_Full = new float[][] {

                new float[] {1.8f, -.3f, -.3f, 0, 0}, //  Red  

                new float[] {-.3f, 1.8f, -.3f, 0, 0}, //  Green

                new float[] {-.3f, -.3f, 1.8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_FullP = new float[][] {

                new float[] {2, -.2f, -.2f, 0, 0}, //  Red  

                new float[] {-.2f, 2, -.2f, 0, 0}, //  Green

                new float[] {-.2f, -.2f, 2, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_FullM = new float[][] {

                new float[] {1.6f, -.4f, -.4f, 0, 0}, //  Red  

                new float[] {-.4f, 1.6f, -.4f, 0, 0}, //  Green

                new float[] {-.4f, -.4f, 1.6f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            float[][] matrixColorize_FullPP = new float[][] {

                new float[] {3f, -1, -1, 0, 0}, //  Red  

                new float[] {-1f, 3f, -1f, 0, 0}, //  Green

                new float[] {-1f, -1f, 3f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixColorize_FullPPM = new float[][] {

                new float[] {3f, -1, -1, 0, 0}, //  Red  

                new float[] {-1f, 3f, -1f, 0, 0}, //  Green

                new float[] {-1f, -1f, 3f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.5f, -.5f, -.5f, 0, 1}

            };



            //////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixRedChannel = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 0, 0, 0, 0}, //  Green

                new float[] {0, 0, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixRedMore = new float[][] {

                new float[] {1.2f, -.1f, -.1f, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixRedMost = new float[][] {

                new float[] {1,  0,0, 0, 0}, //  Red  

                new float[] {0, .8f, 0, 0, 0}, //  Green

                new float[] {0,  0,.8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.2f, 0, 0, 0, 1}

           };

            float[][] matrixRedOnly = new float[][] {

                new float[] {1,0, 0,  0,0}, //  Red  

                new float[] {.34f, .34f, .34f, 0, 0}, //  Green

                new float[] {.34f, .34f, .34f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixRedLess = new float[][] {

                new float[] {.8f, 0.1f, 0.1f, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };





            ///////////////////////////////////////////////////////////////////////////////////////////////

            //////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixGreenChannel = new float[][] {

                new float[] {0, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixGreenMore = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red

                new float[] { -.1f,1.2f, -.1f, 0, 0}, //  Green  

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixGreenMost = new float[][] {

                new float[] {.8f,  0,0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0,  0,.8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, .2f, 0, 0, 1}

           };

            float[][] matrixGreenOnly = new float[][] {

                new float[] {.34f, .34f, .34f, 0, 0}, //  Red

                new float[] {0, 1, 0,  0,0}, //  Green  

                new float[] {.34f, .34f, .34f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixGreenLess = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red

                new float[] { 0.1f,.8f, 0.1f, 0, 0}, //  Green  

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };





            ///////////////////////////////////////////////////////////////////////////////////////////////

            //////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixBlueChannel = new float[][] {

                new float[] {0, 0, 0, 0, 0}, //  Red  

                new float[] {0, 0, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixBlueMore = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {-.1f, -.1f,1.2f, 0, 0}, //  Blue  

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixBlueMost = new float[][] {

                new float[] {.8f,  0,0, 0, 0}, //  Red  

                new float[] {0, .8f, 0, 0, 0}, //  Green

                new float[] {0,  0,1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, .2f, 0, 1}

           };

            float[][] matrixBlueOnly = new float[][] {

                new float[] {.34f, .34f, .34f, 0, 0}, //  Red

                new float[] {.34f, .34f, .34f, 0, 0}, //  Green

                new float[] {0,0, 1,  0,0}, //  Blue  

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixBlueLess = new float[][] {

                new float[] {0, 1, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {.1f, .1f, .8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };





            ///////////////////////////////////////////////////////////////////////////////////////////////

            //////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixCyanChannel = new float[][] {

                new float[] {0, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixCyanMore = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {-.1f, 1.2f, 0, 0, 0}, //  Green

                new float[] {-.1f, 0, 1.2f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixCyanMost = new float[][] {

                new float[] {.8f,  0,0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0,  0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, .2f, .2f, 0, 1}

           };

            float[][] matrixCyanOnly = new float[][] {

                new float[]  {.34f, .34f, .34f, 0, 0},//  Red  

                new float[] {0,1, 0,  0,0}, //  Green

                new float[]  {0,0, 1,  0,0},//  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixCyanLess = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {.01f, .9f, 0, 0, 0}, //  Green

                new float[] {.01f, 0, .9f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };





            ///////////////////////////////////////////////////////////////////////////////////////////////

            //////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixYellowChannel = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixYellowMore = new float[][] {

                new float[] {1.2f, 0, -.1f, 0, 0}, //  Red  

                new float[] {0, 1.2f, -.1f, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixYellowMost = new float[][] {

                new float[] {1,  0,0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0,  0,.8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.2f, .2f, 0, 0, 1}

           };

            float[][] matrixYellowOnly = new float[][] {

                new float[] {1,0, 0,  0,0}, //  Red  

                new float[] {0,1, 0,  0,0}, //  Green

                new float[] {.34f, .34f, .34f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            float[][] matrixYellowLess = new float[][] {

                new float[] {.9f, 0, 0.1f, 0, 0}, //  Red  

                new float[] {0, .9f, 0.1f, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            ///////////////////////////////////////////////////////////////////////////////////////////////

            //////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixMagentaChannel = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 0, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };

            ///////////////////////////////////////////////////////////////////////////////////////////////



            float[][] matrixGolden = new float[][] {

                new float[] {1.2f, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {1, 1, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixGoldenP = new float[][] {

                new float[] {1.5f, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1.3f, 0, 0, 0}, //  Green

                new float[] {1, 1, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };



            float[][] matrixGoldenM = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, .95f, 0, 0, 0}, //  Green

                new float[] {.8f, .8f, .8f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

           };





            ///////////////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixHalfColor = new float[][] {

                new float[] {.7f, .2f, .2f, 0, 0}, //  Red  

                new float[] {.2f, .7f, .2f, 0, 0}, //  Green

                new float[] {.2f, .2f, .7f, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };







            float[][] matrixFullWhite = new float[][] {

                new float[] {1, 1, 1, 0, 0}, //  Red  

                new float[] {1, 1, 1, 0, 0}, //  Green

                new float[] {1, 1, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {1, 1, 1, 0, 1}

           };







            float[][] matrixFullBlack = new float[][] {

                new float[] {0, 0, 0, 0, 0}, //  Red  

                new float[] {0, 0, 0, 0, 0}, //  Green

                new float[] {0, 0, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, 0, 1}

            };



            //////////////////////////////////////////////////////////////////////////////////////////////////////////

            float[][] matrixTransparent = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, -.2f, 1}

            };





            float[][] matrixTransparentP = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.2f, .2f, .2f, -.2f, 1}

            };



            float[][] matrixTransparentPP = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.35f, .35f, .35f, -.2f, 1}

            };





            float[][] matrixTransparentM = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.2f, -.2f, -.2f, -.2f, 1}

            };



            float[][] matrixTransparentMM = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.35f, -.35f, -.35f, -.2f, 1}

            };





            float[][] matrixTransparentMore = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, -.5f, 1}

            };





            float[][] matrixTransparentMoreP = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.4f, .4f, .4f, -.5f, 1}

            };





            float[][] matrixTransparentMorePP = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {.55f, .55f, .55f, -.5f, 1}

            };





            float[][] matrixTransparentMoreM = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.4f, -.4f, -.4f, -.5f, 1}

            };



            float[][] matrixTransparentMoreMM = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-.55f, -.55f, -.55f, -.5f, 1}

            };





            float[][] matrixTransparentMost = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {0, 0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {0, 0, 0, -.7f, 1}

            };



            ///////////////////////////////////////////////////////////////////

            float[][] matrixNegative = new float[][] {

                new float[] {-1, 0, 0, 0, 0}, //  Red  

                new float[] {0, -1, 0, 0, 0}, //  Green

                new float[] {0, 0, -1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {1, 1, 1, 0, 1}

            };



            float[][] matrixCoal = new float[][] {

                new float[] {0, 1, 1, 0, 0}, //  Red  

                new float[] {1, 0, 1, 0, 0}, //  Green

                new float[] {1, 1, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

                new float[] {-1, -1, -1, 0, 1}

            };



            float[][] matrixHue1 = new float[][] {

                new float[] {0, 1, 0, 0, 0}, //  Red  

                new float[] {0, 0, 1, 0, 0}, //  Green

                new float[] {1, 0, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

               new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixHue2 = new float[][] {

                new float[] {0, 0, 1, 0, 0}, //  Red  

                new float[] {1, 0, 0, 0, 0}, //  Green

                new float[] {0, 1, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

               new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixHue3 = new float[][] {

               new float[] {-1, 1, 1, 0, 0}, //  Red  

                new float[] {1, -1, 1, 0, 0}, //  Green

                new float[] {1, 1, -1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

               new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixRepRG = new float[][] {

                new float[] {0, 1, 0, 0, 0}, //  Red  

                new float[] {1, 0, 0, 0, 0}, //  Green

                new float[] {0,0, 1, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

               new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixRepRB = new float[][] {

                new float[] {0, 0, 1, 0, 0}, //  Red  

                new float[] {0, 1, 0, 0, 0}, //  Green

                new float[] {1,0, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

               new float[] {0, 0, 0, 0, 1}

            };

            float[][] matrixRepGB = new float[][] {

                new float[] {1, 0, 0, 0, 0}, //  Red  

                new float[] {0, 0, 1, 0, 0}, //  Green

                new float[] {0, 1, 0, 0, 0}, //  Blue

                new float[] {0, 0, 0, 1, 0}, // Transparency

               new float[] {0, 0, 0, 0, 1}

            };



            ////////////////////////////////////////////////////////////////////////////////







            //  No Effect

            //-

            //-

            //Black White

            //BW Contrast Upper

            //BW Contrast More

            //BW Contrast Most

            //BW Brighter

            //BW Brighter More

            //BW Brighter Most

            //BW Dark

            //BW Darker More

            //BW Darker Most

            //-

            //Contrast Upper

            //Contrast More

            //Contrast Most

            //Contrast Full

            //Brighter

            //Brighter+

            //Brighter More

            //Brighter More+

            //Brighter Most

            //Brighter Most+

            //Bright Full

            //Bright Full+

            //-

            //Dark

            //Dark+

            //Darker More

            //Darker More+

            //Darker Most

            //Darker Most+

            //Dark Full

            //-

            //Colorize

            //Colorize+

            //Colorize-

            //Colorize More

            //Colorize More+

            //Colorize More-

            //Colorize Most

            //Colorize Most+

            //Colorize Most-

            //Colorize Full

            //Colorize Full+

            //Colorize Full-

            //Colorize Full++

            //Colorize Full--

            //-

            //Red More

            //Red Most

            //Red Only

            //Red Channel

            //Red Less

            //-

            //Green More

            //Green Most

            //Green Only

            //Green Channel 

            //Green Less

            //-

            //Blue More

            //Blue Most

            //Blue Only

            //Blue Channel

            //Blue Less

            //-

            //Cyan More

            //Cyan Most

            //Cyan Only

            //Cyan Channel

            //Cyan Less

            //-

            //Yellow More

            //Yellow Most

            //Yellow Only

            //Yellow Channel

            //Yellow Less

            //-

            //Golden

            //Golden Bright

            //Golden Dark

            //-

            //Half Color

            //Full White

            //Full Black

            //-

            //Transparent

            //Transparent+

            //Transparent++

            //Transparent-

            //Transparent--

            //Transparent More

            //Transparent More+

            //Transparent More++

            //Transparent More-

            //Transparent More--

            //Transparent Most





            picMatrix = new float[][][] { 

                matrixNormal,matrixNormal,

                matrixNormal,matrixBW,matrixBW_Contrast,matrixBW_Contrast_More,matrixBW_Contrast_Most,matrixBW_Brighter,matrixBW_Brighter_More,matrixBW_Brighter_Most,matrixBW_Darker,matrixBW_Darker_More,matrixBW_Darker_Most,

                matrixNormal,matrixContrast,matrixContrast_More,matrixContrast_Most,matrixContrast_Full,matrixBright,matrixBrightP,matrixBrighter_More,matrixBrighter_MoreP,matrixBrighter_Most,matrixBrighter_MostP,matrixBright_Full,matrixBright_FullP,

                matrixNormal,matrixDark,matrixDarkP,matrixDarker_More,matrixDarker_MoreP,matrixDarker_Most,matrixDarker_MostP,matrixDarkFull,

                matrixNormal,matrixColorize,matrixColorizeP,matrixColorizeM,matrixColorize_More,matrixColorize_MoreP,matrixColorize_MoreM,matrixColorize_Most,matrixColorize_MostP,matrixColorize_MostM,matrixColorize_Full,matrixColorize_FullP,matrixColorize_FullM,matrixColorize_FullPP,matrixColorize_FullPPM,               

                matrixNormal,matrixRedMore,matrixRedMost,matrixRedOnly,matrixRedChannel,matrixRedLess,

                matrixNormal,matrixGreenMore,matrixGreenMost,matrixGreenOnly,matrixGreenChannel,matrixGreenLess,

                matrixNormal,matrixBlueMore,matrixBlueMost,matrixBlueOnly,matrixBlueChannel,matrixBlueLess,                

                matrixNormal,matrixCyanMore,matrixCyanMost,matrixCyanOnly,matrixCyanChannel,matrixCyanLess,

                matrixNormal,matrixYellowMore,matrixYellowMost,matrixYellowOnly,matrixYellowChannel,matrixYellowLess,               

                matrixNormal,matrixGolden,matrixGoldenP,matrixGoldenM,

                matrixNormal,matrixHalfColor,matrixFullWhite ,matrixFullBlack,

                matrixNormal,matrixTransparent,matrixTransparentP,matrixTransparentPP ,matrixTransparentM,matrixTransparentMM,matrixTransparentMore,matrixTransparentMoreP,matrixTransparentMorePP,matrixTransparentMoreM,matrixTransparentMoreMM,matrixTransparentMost ,

                matrixNormal,matrixNegative,matrixCoal,matrixHue1,matrixHue2,matrixHue3,matrixRepRG,matrixRepRB,matrixRepGB

            };









            anaglyphMatrix = new float[][][] { matrixRedChannel, matrixCyanChannel, matrixRedChannel, matrixCyanChannel, matrixBlueChannel, matrixGreenChannel, matrixYellowChannel, matrixMagentaChannel };









        }



        #endregion





        #region Start to Make a new Scene



        private void btnOK_Click(object sender, System.EventArgs e)

        {

            myObjectsOrientation = 0;

            startAutoRun();

        }



        private void btnRefresh_Click(object sender, EventArgs e)

        {

            myObjectsOrientation = Convert.ToInt16(((ToolStripMenuItem)sender).Tag.ToString());

            goRun(true);

        }



        private void goRun(bool reFresh)

        {

            setPanels(true);

            mnuSaveFast.Enabled = true;

            bool timerStatus = tmrNext.Enabled;

            tmrNext.Enabled = false;

            this.UseWaitCursor = true;

            mnuRun.Enabled = false;

            mnuRefresh.Enabled = false;

            if (chkFullScreen.Checked) setFullScreen(true);

            Application.DoEvents();

            myGeneralFileName = DateTime.Now.ToString("yyyyMMMdd_HHmmss__") +

                (rdoLandscapePersianGulf.Checked ? "Persian_Gulf" : rdoLandscapeGolestanPark.Checked ? "Golestan_Park" : "3D_Mix")

                + "__" + mnuOut1.Text.Trim() + "_" + mnuOut2.Text.Trim();

            myGeneralFileName = myGeneralFileName.Replace("-", "_").Replace(" ", "").Replace(".", "").Replace("(", "_").Replace(")", "_").Replace("[", "_").Replace("]", "_").Replace("=", "_");

            try

            {

                if (!reFresh)

                {

                    setDepth();

                    setControlsSize();

                    resetCollections();

                    startCalculation();

                }

                Application.DoEvents();

                Draw3D();

                showResult(mnuShowAnaglyph.SelectedIndex); // show anaglyph or left or right or red or cyan

                setTitle();

                setDataForSave();



                //if (!reFresh) 

                saveData(stbInfo);

                if (mnuAutoSave.Checked) ImageSave();

                if (mnuShowSnow.Checked)

                    foreach (frmObject mySnow in mySnowCollection) mySnow.Show();



                mnuFile.Select();





            }

            catch (Exception e) { Debug.WriteLine(e.Message); }



            mnuRun.Enabled = true;

            mnuRefresh.Enabled = true;

            this.UseWaitCursor = false;

            tmrNext.Enabled = timerStatus;

        }





        private void setDepth()

        {

            if (chkDepthRandom.Checked)

            {

                int myMin = (int)(trbBaseDepth.Value - updDepthRandom.Value);

                myMin = myMin < trbBaseDepth.Minimum ? trbBaseDepth.Minimum : myMin;



                int myMax = (int)(trbBaseDepth.Value + updDepthRandom.Value);

                myMax = myMax > trbBaseDepth.Maximum ? trbBaseDepth.Maximum : myMax;

                baseDepth = -myRandom.Next(myMin, myMax);



            }

            else baseDepth = -trbBaseDepth.Value;





        }



        private void setControlsSize()

        {

            baseWidthCorrection = trbBaseDepth.Value + 100;



            myOutputWidthCorrected = (int)updOutputWidth.Value;

            myOutputWidth = myOutputWidthCorrected + baseWidthCorrection;

            myOutputHeight = (int)updOutputHeight.Value;





            //int newWidth = (pnlBottom.Size.Width + baseWidthCorrection);

            //int newHeight = (pnlBottom.Size.Height);



            //picAnaglyph.Size =   new Size(newWidth, newHeight);

        }



        private void resetCollections()

        {

            foreach (frmObject mySnow in mySnowCollection) mySnow.Dispose();

        }



        private void showResult(int myItem)

        {

            switch (myItem)

            {

                case 0:

                    picAnaglyph.Image = bmpAnaglyph;

                    break;

                case 1:

                    picAnaglyph.Image = leftBitmap;

                    break;

                case 2:

                    picAnaglyph.Image = rightBitmap;

                    break;

                case 3:

                    picAnaglyph.Image = redBitmap;

                    break;

                case 4:

                    picAnaglyph.Image = cyanBitmap;

                    break;

            }

        }

        #endregion





        #region Main Calculations



        // Main Calculations

        private void startCalculation()

        {



            int rocksType = myRandom.Next(14);

            int cloudsType = myRandom.Next(13);



            myAllPicCollection = new List<picCollection>();

            mySnowCollection = new List<frmObject>();







            myGeneralSize = trbGeneralSize.Value * .05f;

            myViewAngle = (140 - trbViewAngle.Value) * .03f;

            myAltitude = trbAltitude.Value / 4f;

            myGroundHeight = (int)(myOutputHeight / myViewAngle);

            myBackHeight = myOutputHeight - myGroundHeight;



            //selecting Rocks and mountains  with different size for painting on the scene

            if (chkRockObjects.Checked)

            {

                if (picsAll[myObjectTypes.Rock.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updRockObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myTypeNumber = myObjectTypes.Rock.GetHashCode();

                            myPicInfo.myType = myObjectTypes.Rock;

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Rock.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Rock.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthRockStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthRocksMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthRocks.Value / (15 * myRandom.NextDouble() + (100 - trbDepthRocksNoise.Value) / 100f))))

                                , 2);



                            myPicInfo.myScale = (float)(Math.Pow(trbSizeRock.Value, 1.5) / 120 / Math.Pow(myPicInfo.myDepth, (.5 + (trbPerpective.Value - 20) / 100f + trbZoomRocks.Value / 100f)) * myGeneralSize / Math.Pow(myAltitude, .5) + (trbInitialSize.Value / 100f + trbInitialRocks.Value / 100f));

                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineRocks.Text, rocksType);



                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }



            // selecting Clouds  with different size for painting on the scene

            if (chkCloudObjects.Checked)

            {

                if (picsAll[myObjectTypes.Cloud.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updCloudObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myTypeNumber = myObjectTypes.Cloud.GetHashCode();

                            myPicInfo.myType = myObjectTypes.Cloud;

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Cloud.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Cloud.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthCloudsStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthCloudsMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthClouds.Value / (10 * myRandom.NextDouble() + (100 - trbDepthCloudsNoise.Value) / 100f))))

                                , 2);



                            myPicInfo.myScale = (float)(Math.Pow(trbSizeCloud.Value, 1.5) / 50 * myGeneralSize / Math.Pow(myAltitude, .4) + (trbInitialSize.Value / 100f));



                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineClouds.Text, cloudsType);



                            myPicInfo.myY = (myRandom.Next(

                                (int)(1 - myPicInfo.myImage.Height * myPicInfo.myScale),

                                (int)(myBackHeight * 3 / 4f - myPicInfo.myImage.Height * myPicInfo.myScale - myPicInfo.myDepth * myAltitude + (trbInitialCloud.Value - 50) * 10 + (myPicInfo.myDepth * trbZoomCloud.Value / 2))));



                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }







            // making Fog  for painting on the scene

            if (chkFogObjects.Checked)

            {

                if (picsAll[myObjectTypes.Cloud.GetHashCode()].Count > 0) // fog uses clouds objects

                {

                    for (int i = 1; i <= updFogObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myTypeNumber = myObjectTypes.Fog.GetHashCode();

                            myPicInfo.myType = myObjectTypes.Fog;

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Cloud.GetHashCode()].Count);// fog uses clouds objects

                            myPicInfo.myImage = picsAll[myObjectTypes.Cloud.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthFogStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthFogMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthFog.Value / (10 * myRandom.NextDouble() + (100 - trbDepthFogNoise.Value) / 100f))))

                                , 2);

                            myPicInfo.myScale = (float)(Math.Pow(myPicInfo.myDepth, (1 + trbPerpective.Value / 100f + trbZoomFog.Value / 100f)) * Math.Pow(trbSizeFog.Value, 1.2) / 1000 * myGeneralSize / Math.Pow(myAltitude, .5) + (trbInitialFog.Value / 100f + trbInitialFog.Value / 100f));



                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineFog.Text, 0);

                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }







            //selecting Fishes  with different size for painting on the scene

            if (chkFishObject.Checked && !rdoLandscapeGolestanPark.Checked)

            {

                if (picsAll[myObjectTypes.Fish.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updFishesObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myTypeNumber = myObjectTypes.Fish.GetHashCode();

                            myPicInfo.myType = myObjectTypes.Fish;

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Fish.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Fish.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthFishesStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthFishesMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthFish.Value / (15 * myRandom.NextDouble() + (100 - trbDepthFishesNoise.Value) / 100f))))

                                , 2);





                            myPicInfo.myScale = (float)(Math.Pow(myPicInfo.myDepth, (1 + trbPerpective.Value / 100f + trbZoomFishes.Value / 100f)) * Math.Pow(trbSizeFish.Value, 1.3) / 25000 * myGeneralSize / Math.Pow(myAltitude, .5) + (trbInitialSize.Value / 100f + trbInitialFishes.Value / 100f));

                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineFishes.Text, 0);

                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }









            //selecting Ship and boats  with different size for painting on the scene

            if (chkShipObject.Checked && !rdoLandscapeGolestanPark.Checked)

            {

                if (picsAll[myObjectTypes.Ship.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updShipObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myTypeNumber = myObjectTypes.Ship.GetHashCode();

                            myPicInfo.myType = myObjectTypes.Ship;

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Ship.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Ship.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthShipStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthShipMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthShip.Value / (15 * myRandom.NextDouble() + (100 - trbDepthShipNoise.Value) / 100f))))

                                , 2);



                            myPicInfo.myScale = (float)(Math.Pow(myPicInfo.myDepth, (1 + trbPerpective.Value / 100f + trbZoomShips.Value / 100f)) * Math.Pow(trbSizeShip.Value, 1.3) / 25000 * myGeneralSize / Math.Pow(myAltitude, .5) + (trbInitialSize.Value / 100f + trbInitialShip.Value / 100f));

                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineShips.Text, 0);

                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }







            // selecting Flowers  with different size for painting on the scene

            if (chkFlowerObject.Checked && !rdoLandscapePersianGulf.Checked)

            {

                if (picsAll[myObjectTypes.Flower.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updFlowerObject.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myType = myObjectTypes.Flower;

                            myPicInfo.myTypeNumber = myObjectTypes.Flower.GetHashCode();

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Flower.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Flower.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                               (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthFlowerStart.Value) / 100f)

                               + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthFlowerMinimum.Value / 100f)))

                               + (myRandom.NextDouble() * ((float)trbDepthFlower.Value / (15 * myRandom.NextDouble() + (100 - trbDepthFlowerNoise.Value) / 100f))))

                               , 2);



                            myPicInfo.myScale = (float)(Math.Pow(myPicInfo.myDepth, (1 + trbPerpective.Value / 100f + trbZoomFlowers.Value / 100f)) * Math.Pow(trbSizeFlower.Value, 1.3) / 12000f * myGeneralSize / Math.Pow(myAltitude, .4f) + (trbInitialSize.Value / 100f + trbInitialFlowers.Value / 100f));



                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineFlowers.Text, 0);

                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }





            //selecting Trees  with different size for painting on the scene

            if (chkTreeObject.Checked && !rdoLandscapePersianGulf.Checked)

            {

                if (picsAll[myObjectTypes.Tree.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updTreeObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myType = myObjectTypes.Tree;

                            myPicInfo.myTypeNumber = myObjectTypes.Tree.GetHashCode();

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Tree.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Tree.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthTreetart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthTreeMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthTree.Value / (15 * myRandom.NextDouble() + (100 - trbDepthTreeNoise.Value) / 100f))))

                                , 2);



                            myPicInfo.myScale = (float)(Math.Pow(myPicInfo.myDepth, (1 + trbPerpective.Value / 100f + trbZoomTrees.Value / 100f)) * Math.Pow(trbSizeTree.Value, 1.8) / 5000 * myGeneralSize / Math.Pow(myAltitude, .5) + (trbInitialSize.Value / 100f + trbInitialTrees.Value / 100f));

                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineTree.Text, 0);



                            if (myPicInfo.myDepth < (Math.Abs(baseDepth))) // I don't want to show trees in front of the monitor screen 

                                myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }















            // selecting Animals  with different size for painting on the scene

            if (chkAnimalObjects.Checked && !rdoLandscapePersianGulf.Checked)

            {

                if (picsAll[myObjectTypes.Animal.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updAnimalObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myTypeNumber = myObjectTypes.Animal.GetHashCode();

                            myPicInfo.myType = myObjectTypes.Animal;

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Animal.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Animal.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthAnimalsStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthAnimalsMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthAnimals.Value / (15 * myRandom.NextDouble() + (100 - trbDepthAnimalsNoise.Value) / 100f))))

                                , 2);



                            myPicInfo.myScale = (float)(Math.Pow(myPicInfo.myDepth, (1 + trbPerpective.Value / 100f + trbZoomAnimals.Value / 100f)) * Math.Pow(trbSizeAnimal.Value, 1.3) / 1500 * myGeneralSize / Math.Pow(myAltitude, .5) + (trbInitialSize.Value / 100f + trbInitialAnimal.Value / 100f));

                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineAnimals.Text, 0);

                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }





            // selecting Humans  with different size for painting on the scene

            if (chkHumanObject.Checked && !rdoLandscapePersianGulf.Checked)

            {

                if (picsAll[myObjectTypes.Human.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updHumansObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myType = myObjectTypes.Human;

                            myPicInfo.myTypeNumber = myObjectTypes.Human.GetHashCode();

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Human.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Human.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthHumansStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthHumansMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthHuman.Value / (15 * myRandom.NextDouble() + (100 - trbDepthHumansNoise.Value) / 100f))))

                                , 2);



                            myPicInfo.myScale = (float)(Math.Pow(myPicInfo.myDepth, (1 + trbPerpective.Value / 100f + trbZoomHumans.Value / 100f)) * Math.Pow(trbSizeHuman.Value, 1.3) / 2300 * myGeneralSize / Math.Pow(myAltitude, .5) + (trbInitialSize.Value / 100f + trbInitialHumans.Value / 100f));

                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineHumans.Text, 0);

                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }





            // selecting Birds  with different size for painting on the scene

            if (chkBirdObjects.Checked)

            {

                if (picsAll[myObjectTypes.Bird.GetHashCode()].Count > 0)

                {

                    for (int i = 1; i <= updBirdObjects.Value; i++)

                    {

                        try

                        {

                            myPicInfo = new picCollection();

                            myPicInfo.myType = myObjectTypes.Bird;

                            myPicInfo.myTypeNumber = myObjectTypes.Bird.GetHashCode();

                            myPicInfo.myOrientation = myRandom.Next(2);

                            myPicInfo.myImageNumber = myRandom.Next(picsAll[myObjectTypes.Bird.GetHashCode()].Count);

                            myPicInfo.myImage = picsAll[myObjectTypes.Bird.GetHashCode()][myPicInfo.myImageNumber];

                            myPicInfo.myImage2 = myPicInfo.myImage;

                            myPicInfo.myDepth = (float)Math.Round(

                                (((Math.Abs(baseDepth) * (trbStartingDepthGeneral.Value + trbDepthBirdsStart.Value) / 100f)

                                + myRandom.NextDouble() * ((Math.Abs(baseDepth) * trbDepthBirdsMinimum.Value / 100f)))

                                + (myRandom.NextDouble() * ((float)trbDepthBirds.Value / (10 * myRandom.NextDouble() + (100 - trbDepthBirdsNoise.Value) / 100f))))

                                , 2);



                            myPicInfo.myScale = (float)(myPicInfo.myDepth * Math.Pow(trbSizeBird.Value, (1 + trbPerpective.Value / 100f + trbZoomBirds.Value / 100f)) / 5000 * myGeneralSize / Math.Pow(myAltitude, .4) + (trbInitialSize.Value / 100f + trbInitialBirds.Value / 100f));

                            myPicInfo.myX = calculateX(myPicInfo, cmbXAlineBirds.Text, 0);

                            myPicInfo.myY = (myRandom.Next((int)(myBackHeight - myPicInfo.myImage.Height * myPicInfo.myScale + myPicInfo.myDepth / 2f - 150 + myAltitude)));



                            myAllPicCollection.Add(myPicInfo);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }





            int mySnowSurface = (int)(myBackHeight - (float)baseDepth * myAltitude);

            float heightScale = picAnaglyph.Height / (float)updOutputHeight.Value;



            // Snow 

            if (mnuShowSnow.Checked && chkSnowObjects.Checked && this.Height > 200)

            {

                if (picsAll[myObjectTypes.Snow.GetHashCode()].Count > 0)

                {



                    for (int i = 1; i < trbSnow.Value; i++)

                    {

                        try

                        {

                            frmObject frmSnow = new frmObject();



                            frmSnow.MyBasePosition = this.Location;

                            frmSnow.MyBaseSize = this.Size;

                            frmSnow.borderLeft = borderLeft;

                            frmSnow.borderTop = borderTop;

                            frmSnow.borderMenu = mainMenu.Height;

                            frmSnow.heightScale = heightScale;

                            frmSnow.isFullScreen = isFullScreen;

                            frmSnow.myDepth = myRandom.Next(40 / myRandom.Next(1, 4));

                            frmSnow.tmrMain.Interval = myRandom.Next(60 - frmSnow.myDepth, 70 - frmSnow.myDepth);

                            frmSnow.MyDirectionVertical = true;

                            frmSnow.MyMovementType = 1;

                            frmSnow.MyMoveSpeed = 1 + frmSnow.myDepth / 20;

                            frmSnow.myMoveDirection = myDirection.Positive;//  (myRandom.Next(2) == 0 ? myDirection.Positive : myDirection.Negative);



                            frmSnow.MyDirectionLimitMin = myRandom.Next(-500, -100);

                            frmSnow.MyDirectionLimitMax = picAnaglyph.Height + myRandom.Next(100, 500);

                            frmSnow.mySurface = mySnowSurface;



                            frmSnow.myPosition = new Point(myRandom.Next(this.Width), this.Height + 100);



                            frmSnow.myType = myObjectTypes.Snow;

                            frmSnow.btmR = (Bitmap)picsAll[myObjectTypes.Snow.GetHashCode()][myRandom.Next(picsAll[myObjectTypes.Snow.GetHashCode()].Count)];

                            frmSnow.btmL = null;



                            mySnowCollection.Add(frmSnow);

                        }

                        catch (ArgumentOutOfRangeException)

                        {

                            continue;

                        }

                    }

                }

            }









        }

        // Calculation of X Position of objects

        private float calculateX(picCollection myPicInfo, string alignType, int myType)

        {

            string alignTypeEdited = alignType.Trim();

            float newX = 0;



            // when user select LR alignment (Left+Right noCenter) 

            switch (alignTypeEdited)

            {

                case "LR 10%":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 10%" : "Right 10%";

                    break;

                case "LR 10%+B":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 10%+B" : "Right 10%+B";

                    break;

                case "LR 25%":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 25%" : "Right 25%";

                    break;

                case "LR 25%+B":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 25%+B" : "Right 25%+B";

                    break;

                case "LR 35%":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 35%" : "Right 35%";

                    break;

                case "LR 35%+B":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 35%+B" : "Right 35%+B";

                    break;

                case "LR 50%":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 50%" : "Right 50%";

                    break;

                case "LR 50%+B":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 50%+B" : "Right 50%+B";

                    break;

                case "LR 75%":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 75%" : "Right 75%";

                    break;

                case "LR 75%+B":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 75%+B" : "Right 75%+B";

                    break;

                case "LR 90%":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 90%" : "Right 90%";

                    break;

                case "LR 90%+B":

                    alignTypeEdited = myRandom.Next(2) == 0 ? "Left 90%+B" : "Right 90%+B";

                    break;

            }



            // X alignment

            switch (alignTypeEdited)

            {

                case "Total Width":

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                                myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

                case "Total+Border":

                    newX = (myRandom.Next(

                        -(int)(myPicInfo.myImage.Width * myPicInfo.myScale),

                        myOutputWidthCorrected));

                    break;

                case "Left 10%":

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                       (int)(myOutputWidthCorrected * .1f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 10%+B":

                    newX = (myRandom.Next(

                        -(int)(myPicInfo.myImage.Width * myPicInfo.myScale),

                         (int)(myOutputWidthCorrected * .1f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 25%":

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                       (int)(myOutputWidthCorrected * .25f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 25%+B":

                    newX = (myRandom.Next(

                        -(int)(myPicInfo.myImage.Width * myPicInfo.myScale),

                         (int)(myOutputWidthCorrected * .25f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 35%":

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                       (int)(myOutputWidthCorrected * .35f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 35%+B":

                    newX = (myRandom.Next(

                        -(int)(myPicInfo.myImage.Width * myPicInfo.myScale),

                         (int)(myOutputWidthCorrected * .35f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 50%":

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                       (int)(myOutputWidthCorrected * .5f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 50%+B":

                    newX = (myRandom.Next(

                        -(int)(myPicInfo.myImage.Width * myPicInfo.myScale),

                         (int)(myOutputWidthCorrected * .5f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 75%":

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                       (int)(myOutputWidthCorrected * .75f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 75%+B":

                    newX = (myRandom.Next(

                        -(int)(myPicInfo.myImage.Width * myPicInfo.myScale),

                         (int)(myOutputWidthCorrected * .75f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 90%":

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                       (int)(myOutputWidthCorrected * .9f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Left 90%+B":

                    newX = (myRandom.Next(

                        -(int)(myPicInfo.myImage.Width * myPicInfo.myScale),

                         (int)(myOutputWidthCorrected * .9f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;



                case "Center 10%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected / 2f - myOutputWidthCorrected * .05f),

                       (int)(myOutputWidthCorrected / 2f + myOutputWidthCorrected * .05f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Center 25%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected / 2f - myOutputWidthCorrected * .125f),

                       (int)(myOutputWidthCorrected / 2f + myOutputWidthCorrected * .125f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Center 35%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected / 2f - myOutputWidthCorrected * .175f),

                       (int)(myOutputWidthCorrected / 2f + myOutputWidthCorrected * .175f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Center 50%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected / 2f - myOutputWidthCorrected * .25f),

                       (int)(myOutputWidthCorrected / 2f + myOutputWidthCorrected * .25f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Center 75%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected / 2f - myOutputWidthCorrected * .375f),

                       (int)(myOutputWidthCorrected / 2f + myOutputWidthCorrected * .375f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;

                case "Center 90%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected / 2f - myOutputWidthCorrected * .45f),

                       (int)(myOutputWidthCorrected / 2f + myOutputWidthCorrected * .45f - (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    break;



                case "Right 10%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .1f),

                        myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

                case "Right 10%+B":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .1f),

                        myOutputWidthCorrected));

                    break;

                case "Right 25%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .25f),

                        myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

                case "Right 25%+B":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .25f),

                        myOutputWidthCorrected));

                    break;

                case "Right 35%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .35f),

                        myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

                case "Right 35%+B":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .35f),

                        myOutputWidthCorrected));

                    break;

                case "Right 50%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .5f),

                        myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

                case "Right 50%+B":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .5f),

                        myOutputWidthCorrected));

                    break;

                case "Right 75%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .75f),

                        myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

                case "Right 75%+B":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .75f),

                        myOutputWidthCorrected));

                    break;



                case "Right 90%":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .9f),

                        myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

                case "Right 90%+B":

                    newX = (myRandom.Next(

                       (int)(myOutputWidthCorrected - myOutputWidthCorrected * .9f),

                        myOutputWidthCorrected));

                    break;



                case "Special":

                    if (myType == 1) newX = (myRandom.Next(-(int)myPicInfo.myImage.Width, (int)(myOutputWidthCorrected / 4 - myPicInfo.myDepth * myOutputWidthCorrected / 40 - (int)(myPicInfo.myImage.Width * myPicInfo.myScale / 2))));

                    else if (myType == 2) newX = (myRandom.Next((int)(myOutputWidthCorrected / 4 + myPicInfo.myDepth * myOutputWidthCorrected / 40), (int)(myOutputWidthCorrected + (myPicInfo.myImage.Width * myPicInfo.myScale / 2))));

                    else if (myType == 3) newX = (myRandom.Next(-(int)myPicInfo.myImage.Width, (int)(myOutputWidthCorrected / 6 + myPicInfo.myDepth * myOutputWidthCorrected / 60 - (int)(myPicInfo.myImage.Width * myPicInfo.myScale / 2))));

                    else if (myType == 4) newX = (myRandom.Next((int)(myOutputWidthCorrected / 2 - myPicInfo.myDepth * myOutputWidthCorrected / 50), (int)(myOutputWidthCorrected + (myPicInfo.myImage.Width * myPicInfo.myScale / 2))));

                    else if (myType == 5) newX = (myRandom.Next((int)(-myOutputWidthCorrected / 2 + myPicInfo.myDepth * myOutputWidthCorrected / 5), (int)(myOutputWidthCorrected + (myPicInfo.myImage.Width * myPicInfo.myScale / 2))));

                    else if (myType == 6) newX = (myRandom.Next(2) == 0 ? (myRandom.Next(-(int)myPicInfo.myImage.Width, (int)(myOutputWidthCorrected / 5 - myPicInfo.myImage.Width))) : (myRandom.Next(myOutputWidthCorrected * 2 / 3, myOutputWidthCorrected)));

                    else if (myType == 7) newX = (myRandom.Next((int)(myOutputWidthCorrected / 20 + myPicInfo.myDepth * myOutputWidthCorrected / 30), (int)(myOutputWidthCorrected / 2 - (myPicInfo.myImage.Width * myPicInfo.myScale / 1.5f))));

                    else if (myType == 8) newX = (myRandom.Next((int)(myOutputWidthCorrected / 5 + myPicInfo.myDepth * myOutputWidthCorrected / 10), (int)(myOutputWidthCorrected / 20 + (myPicInfo.myImage.Width * myPicInfo.myScale))));

                    else if (myType == 9) newX = (myRandom.Next((int)(myOutputWidthCorrected / 6f), (int)(Math.Cos(myPicInfo.myDepth / 1.5f * Math.PI / 180) * myOutputWidthCorrected / 5f)));

                    else if (myType == 10) newX = (myRandom.Next((int)(Math.Sin(myPicInfo.myDepth / 1.1f * Math.PI / 180) * myOutputWidthCorrected), myOutputWidthCorrected));

                    else if (myType == 11) newX = (myRandom.Next((int)(myOutputWidthCorrected / 2 - Math.Sin(myPicInfo.myDepth * Math.PI / 180) * myOutputWidthCorrected), (int)(myOutputWidthCorrected / 2f + Math.Sin(myPicInfo.myDepth * Math.PI / 180) * myOutputWidthCorrected - myPicInfo.myImage.Width * myPicInfo.myScale)));

                    else newX = (myRandom.Next(2) == 0 ? (myRandom.Next(-(int)myPicInfo.myImage.Width, (int)(myOutputWidthCorrected / 5 - myPicInfo.myImage.Width * myPicInfo.myScale))) : (myRandom.Next(myOutputWidthCorrected * 2 / 3, myOutputWidthCorrected)));



                    break;





                default:

                    newX = (myRandom.Next(

                       ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : (int)(myPicInfo.myDepth + baseDepth)),

                                myOutputWidthCorrected - (int)(myPicInfo.myImage.Width * myPicInfo.myScale) - ((myPicInfo.myDepth + baseDepth) < 0 ? 0 : -(int)(myPicInfo.myDepth + baseDepth))));

                    break;

            }



            return newX;

        }







        #endregion





        #region Drawings



        // Main Drawing Part

        private void Draw3D()

        {

            leftBitmap = new Bitmap(myOutputWidthCorrected, myOutputHeight);

            Graphics gLeft = Graphics.FromImage(leftBitmap);

            gLeft.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            gLeft.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;



            rightBitmap = new Bitmap(myOutputWidthCorrected, myOutputHeight);

            Graphics gRight = Graphics.FromImage(rightBitmap); ;

            gRight.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            gRight.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;



            if (rdoLandscape3D.Checked)

            {

                // when you have a 3D image as background and the ground

                DrawBack3D(gLeft, gRight);

            }



            else

            {

                if (chkRandomSky.Checked) // random image for sky

                {

                    picSkySelected = myRandom.Next(2, picsAll[myObjectTypes.Sky.GetHashCode()].Count);

                    picSky.BackgroundImage = picsAll[myObjectTypes.Sky.GetHashCode()][picSkySelected];

                }



                if (chkRandomGround.Checked)// random image for ground

                {

                    picGroundSelected = myRandom.Next(2, picsAll[myObjectTypes.Ground.GetHashCode()].Count);

                    picGround.BackgroundImage = picsAll[myObjectTypes.Ground.GetHashCode()][picGroundSelected];

                }



                if (chkRandomWater.Checked)// random image for water

                {

                    picWaterSelected = myRandom.Next(1, picsAll[myObjectTypes.Water.GetHashCode()].Count);

                    picWater.BackgroundImage = picsAll[myObjectTypes.Water.GetHashCode()][picWaterSelected];

                }



                DrawSky(gLeft, gRight);

                DrawBase(gLeft, gRight);

            }



            // find maximum depth of objects

            maxDepth = 0;

            minDepth = 1000;

            meanDepth = 0;



            foreach (picCollection myP in myAllPicCollection)

            {

                meanDepth += myP.myDepth;

                if (myP.myDepth > maxDepth) maxDepth = myP.myDepth;

                if (myP.myDepth < minDepth) minDepth = myP.myDepth;

            }



            stbInfo = new StringBuilder();

            // drawing all objects of the collection in order by depth on the scene

            for (int d = (int)(minDepth * 100); d <= maxDepth * 100; d++)

            {

                foreach (picCollection myP in myAllPicCollection)

                {

                    if (d == (int)(myP.myDepth * 100))

                    {

                        try

                        {



                            {

                                DrawObjects(gLeft, gRight, myP);



                                //append data to save on file

                                stbInfo.Append(stbPicInfo(myP).ToString());

                            }

                        }

                        catch (Exception e) { Debug.WriteLine("error 234: " + e.Message); }

                    }

                }

            }



            if (mnuShowDepthCrossing.Checked) // drawing guiding lines to show depth values on the image

                DrawGuidLines(gLeft, gRight);





            goAnaglyph();



        }



        // Draw a 3D file as background

        private void DrawBack3D(Graphics gLeftx, Graphics gRightx)

        {

            // Create ImageAttributes and Set Color Matrix

            ImageAttributes imgAtt = new ImageAttributes();

            imgAtt.SetColorMatrix(new ColorMatrix(picMatrix[0]), ColorMatrixFlag.Default, ColorAdjustType.Default);



            gLeftx.DrawImage(picBack3D.BackgroundImage, new Rectangle(0, 0, myOutputWidth, myOutputHeight), 0, 0, picBack3D.BackgroundImage.Width, picBack3D.BackgroundImage.Height, GraphicsUnit.Pixel, imgAtt);

            gRightx.DrawImage(picBack3D.BackgroundImage, new Rectangle(0, 0, myOutputWidth, myOutputHeight), 0, 0, picBack3D.BackgroundImage.Width, picBack3D.BackgroundImage.Height, GraphicsUnit.Pixel, imgAtt);

        }





        // Draw Sky on the scene

        private void DrawSky(Graphics gLeftx, Graphics gRightx)

        {

            // Create ImageAttributes and Set Color Matrix

            ImageAttributes imgAtt = new ImageAttributes();

            // if you select a special effect for sky, system uses it, otherwie system uses general effect

            ColorMatrix myMatrix = new ColorMatrix(picMatrix[(cmbSkyEffect.SelectedIndex > 0 ? cmbSkyEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

            imgAtt.SetColorMatrix(myMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);



            gLeftx.DrawImage(picSky.BackgroundImage, new Rectangle(baseDepth, 0, myOutputWidth, myBackHeight), 0, 0, picSky.BackgroundImage.Width, picSky.BackgroundImage.Height, GraphicsUnit.Pixel, imgAtt);

            gRightx.DrawImage(picSky.BackgroundImage, new Rectangle(0, 0, myOutputWidth, myBackHeight), 0, 0, picSky.BackgroundImage.Width, picSky.BackgroundImage.Height, GraphicsUnit.Pixel, imgAtt);

        }





        // Draw Ground or Water on the scene

        private void DrawBase(Graphics gLeftx, Graphics gRightx)

        {



            Image myBaseImage;

            ColorMatrix myMatrix;



            // Persian Gulf or Golestan Park selected?

            if (rdoLandscapePersianGulf.Checked)

            {

                // Persian Gulf - image for water

                myBaseImage = picWater.BackgroundImage;

                // if you select a special effect for  water, system uses it, otherwie system uses general effect

                myMatrix = new ColorMatrix(picMatrix[(cmbWaterEffect.SelectedIndex > 0 ? cmbWaterEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);



            }

            else

            {

                // Golestan Park - image for ground

                myBaseImage = picGround.BackgroundImage;

                // if you select a special effect for  ground, system uses it, otherwie system uses general effect

                myMatrix = new ColorMatrix(picMatrix[(cmbGroundEffect.SelectedIndex > 0 ? cmbGroundEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);



            }



            // Create ImageAttributes and Set Color Matrix

            ImageAttributes imgAtt = new ImageAttributes();

            imgAtt.SetColorMatrix(myMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);



            //by skewing one of the images, we make landscape depth

            Point[] skewPoints = {

                                    new Point(0, myBackHeight ),  // upper-left point

                                    new Point((int)(myOutputWidth+(myGroundHeight /myAltitude)), myBackHeight),  // upper-right point  

                                    new Point((int)(-myGroundHeight /myAltitude ), myOutputHeight)  // lower-left point 

                                  };







            gLeftx.DrawImage(myBaseImage, new Rectangle(baseDepth, myBackHeight, (int)(myOutputWidth + myGroundHeight / myAltitude), myGroundHeight), 0, 0, myBaseImage.Width, myBaseImage.Height, GraphicsUnit.Pixel, imgAtt);

            gRightx.DrawImage(myBaseImage, skewPoints, new Rectangle(0, 0, myBaseImage.Width, myBaseImage.Height), GraphicsUnit.Pixel, imgAtt);

        }





        // Draw Objects on the scene

        private void DrawObjects(Graphics gLeftx, Graphics gRightx, picCollection myP)

        {

            int myY_Correction = 0;

            ColorMatrix myMatrix = new ColorMatrix();





            // you can deactivate some objects in refresh time. also make special effects for groups of objects

            switch (myP.myType)

            {

                case myObjectTypes.Cloud:

                    if (!chkCloudObjects.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbCloudEffect.SelectedIndex > 0 ? cmbCloudEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionClouds.Value;

                    break;



                case myObjectTypes.Fog:

                    if (!chkFogObjects.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbFogEffect.SelectedIndex > 0 ? cmbFogEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionFog.Value;

                    break;



                case myObjectTypes.Rock:

                    if (!chkRockObjects.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbRockEffect.SelectedIndex > 0 ? cmbRockEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionRocks.Value;

                    break;





                case myObjectTypes.Bird:

                    if (!chkBirdObjects.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbBirdEffect.SelectedIndex > 0 ? cmbBirdEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionBirds.Value;

                    break;



                case myObjectTypes.Ship:

                    if (!chkShipObject.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbShipEffect.SelectedIndex > 0 ? cmbShipEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionShips.Value;

                    break;



                case myObjectTypes.Fish:

                    if (!chkFishObject.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbFishEffect.SelectedIndex > 0 ? cmbFishEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionFishes.Value;

                    break;



                case myObjectTypes.Human:

                    if (!chkHumanObject.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbHumanEffect.SelectedIndex > 0 ? cmbHumanEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionHumans.Value;

                    break;



                case myObjectTypes.Animal:

                    if (!chkAnimalObjects.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbAnimalEffect.SelectedIndex > 0 ? cmbAnimalEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionAnimals.Value;

                    break;



                case myObjectTypes.Flower:

                    if (!chkFlowerObject.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbFlowerEffect.SelectedIndex > 0 ? cmbFlowerEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionFlowers.Value;

                    break;



                case myObjectTypes.Tree:

                    if (!chkTreeObject.Checked) return;

                    myMatrix = new ColorMatrix(picMatrix[(cmbTreeEffect.SelectedIndex > 0 ? cmbTreeEffect.SelectedIndex : cmbGeneralEffect.SelectedIndex)]);

                    myY_Correction = (int)updYCorrectionTree.Value;

                    break;



            }



            Bitmap tempImage = new Bitmap(myP.myImage);

            Bitmap tempImage2 = new Bitmap(myP.myImage2);



            switch (myObjectsOrientation)

            {

                case 0:

                case 1:

                    if (myP.myOrientation == 1)

                    {

                        tempImage.RotateFlip(RotateFlipType.RotateNoneFlipX);

                        tempImage2.RotateFlip(RotateFlipType.RotateNoneFlipX);

                    }

                    break;

                case 2:

                    if (myP.myOrientation == 0)

                    {

                        tempImage.RotateFlip(RotateFlipType.RotateNoneFlipX);

                        tempImage2.RotateFlip(RotateFlipType.RotateNoneFlipX);

                    }

                    break;

                case 3:

                    if (myRandom.Next(2) == 0)

                    {

                        tempImage.RotateFlip(RotateFlipType.RotateNoneFlipX);

                        tempImage2.RotateFlip(RotateFlipType.RotateNoneFlipX);

                    }



                    break;

                case 4:

                    // 

                    break;

                case 5:

                    {

                        tempImage.RotateFlip(RotateFlipType.RotateNoneFlipX);

                        tempImage2.RotateFlip(RotateFlipType.RotateNoneFlipX);

                    }

                    break;

            }



            // Create ImageAttributes and Set Color Matrix

            ImageAttributes imgAtt = new ImageAttributes();

            imgAtt.SetColorMatrix(myMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);





            if (myP.myType != myObjectTypes.Bird && myP.myType != myObjectTypes.Cloud)

                myP.myY = myBackHeight

                   - ((float)myP.myImage.Height * myP.myScale)

                   + (myAltitude * myP.myDepth)

                   + myAltitude;

            int mynewY = (int)myP.myY + trbDigging.Value + myY_Correction + myP.myY_Correction;



            gLeftx.DrawImage(tempImage, new Rectangle((int)myP.myX, (int)(mynewY), (int)(tempImage.Width * myP.myScale), (int)(tempImage.Height * myP.myScale)), 0, 0, tempImage.Width, tempImage.Height, GraphicsUnit.Pixel, imgAtt);

            gRightx.DrawImage(tempImage2, new Rectangle((int)(myP.myX - myP.myDepth - baseDepth), (int)(mynewY), (int)(tempImage2.Width * myP.myScale), (int)(tempImage2.Height * myP.myScale)), 0, 0, tempImage2.Width, tempImage2.Height, GraphicsUnit.Pixel, imgAtt);

            tempImage.Dispose();

            tempImage2.Dispose();

        }





        // Draw Guid lines

        private void DrawGuidLines(Graphics gLeftx, Graphics gRightx)

        {

            for (int j = 0; j < 100; j++)

            {

                if (j > 4) j++;

                if (j > 8) j += 2;

                if (j > 16) j += 4;



                Brush myBrush = (j == 4 ? Brushes.Black : Brushes.White);

                int myGuide = (int)(myBackHeight - (float)baseDepth * j / 4f * myAltitude);



                gLeftx.DrawLine(new Pen(myBrush, 2f), 0, myGuide, myOutputWidth, myGuide);

                gRightx.DrawLine(new Pen(myBrush, 2f), 0, myGuide, myOutputWidth, myGuide);

                gLeftx.DrawString("Depth= " + (j * 25) + " % (" + (int)(-baseDepth * j / 4f) + ")", new Font("Arial", 20f, FontStyle.Bold), myBrush, 5, myGuide + 2);

                gRightx.DrawString("Depth= " + (j * 25) + " % (" + (int)(-baseDepth * j / 4f) + ")", new Font("Arial", 20f, FontStyle.Bold), myBrush, 5, myGuide + 2);

            }



        }





        #endregion





        #region Anaglyph



        private void goAnaglyph()

        {



            Rectangle myRectangle = new Rectangle(0, 0, myOutputWidthCorrected, myOutputHeight);



            // Create left Graphics

            Bitmap bmpSource = new Bitmap(leftBitmap);

            Bitmap bmpOutputLeft = new Bitmap(myOutputWidthCorrected, myOutputHeight);



            Graphics g = Graphics.FromImage(bmpOutputLeft);

            g.Clear(System.Drawing.Color.Transparent);

            ImageAttributes imgAttribs = new ImageAttributes();

            // Set color matrix

            imgAttribs.SetColorMatrix(new ColorMatrix(anaglyphMatrix[0]), ColorMatrixFlag.Default, ColorAdjustType.Default);

            // Draw image with ImageAttributes

            g.DrawImage(bmpSource, myRectangle, 0, 0, bmpSource.Width, bmpSource.Height, GraphicsUnit.Pixel, imgAttribs);

            bmpSource.Dispose();

            g.Dispose();



            // Create right Graphics 

            bmpSource = new Bitmap(rightBitmap);

            Bitmap bmpOutputRight = new Bitmap(myOutputWidthCorrected, myOutputHeight);



            g = Graphics.FromImage(bmpOutputRight);

            g.Clear(System.Drawing.Color.Transparent);

            imgAttribs = new ImageAttributes();

            // Set color matrix

            imgAttribs.SetColorMatrix(new ColorMatrix(anaglyphMatrix[1]), ColorMatrixFlag.Default, ColorAdjustType.Default);

            // Draw image with ImageAttributes

            g.DrawImage(bmpSource, myRectangle, 0, 0, bmpSource.Width, bmpSource.Height, GraphicsUnit.Pixel, imgAttribs);

            bmpSource.Dispose();

            g.Dispose();



            redBitmap = new Bitmap(bmpOutputLeft);

            cyanBitmap = new Bitmap(bmpOutputRight);



            unsafe //mixing colors

            {

                BitmapData bmpData = bmpOutputLeft.LockBits(myRectangle, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);

                Color myPixel;





                for (int y = 0; y < bmpData.Height; y++)

                {

                    byte* myRow = (byte*)bmpData.Scan0 + (y * bmpData.Stride);

                    for (int x = 0, p = 0; x < bmpData.Width; p += 3, x++)

                    {

                        myPixel = bmpOutputRight.GetPixel(x, y);





                        myRow[p] += myPixel.B;

                        myRow[p + 1] += myPixel.G;

                        myRow[p + 2] += myPixel.R;



                    }

                }

                bmpOutputLeft.UnlockBits(bmpData);

            }

            bmpOutputRight.Dispose();

            bmpAnaglyph = new Bitmap(myOutputWidthCorrected, myOutputHeight);

            g = Graphics.FromImage(bmpAnaglyph);

            g.DrawImage(bmpOutputLeft, 0, 0, new Rectangle(0, 0, myOutputWidthCorrected, myOutputHeight), GraphicsUnit.Pixel);

            bmpOutputLeft.Dispose();



        }





        #endregion





        #region collect data and Save output



        private StringBuilder stbPicInfo(picCollection myP)

        {



            StringBuilder sb = new StringBuilder();



            sb.AppendLine("-> ");

            sb.Append(myP.myDepth);

            sb.Append(" , ");

            sb.Append(myP.myType.GetHashCode());

            sb.Append(" , ");

            sb.Append(myP.myType);

            sb.Append(" , ");

            sb.Append(myP.myImageNumber);

            sb.Append(" , ");

            sb.Append(myP.myX);

            sb.Append(" , ");

            sb.Append(myP.myY);

            sb.Append(" , ");

            sb.Append(myP.myY_Correction);

            sb.Append(" , ");

            sb.Append(myP.myScale);

            sb.Append(" , ");

            sb.Append(myP.myOrientation);

            sb.Append(" , ");

            sb.Append(myP.myImage.Width);

            sb.Append(" , ");

            sb.Append(myP.myImage.Height);

            sb.Append(" , ");

            sb.Append("@&@");



            return sb;

        }







        private void setDataForSave()

        {



            StringBuilder stbMain = new StringBuilder();



            // //append data to save on file

            stbMain.AppendLine("[Persian Gulf Anaglyph]");

            stbMain.AppendLine("[ver:  1.0.3]");

            stbMain.AppendLine("-----------");

            stbMain.AppendLine(myGeneralFileName);

            stbMain.AppendLine("-----------");

            stbMain.AppendLine(myTitle);

            stbMain.AppendLine("-----------");

            stbMain.AppendLine("#&*!@$%*");

            stbMain.AppendLine("-----------");

            stbMain.AppendLine();

            stbMain.AppendLine("[START]");



            stbMain.AppendLine();

            stbMain.AppendLine("(window size = " + this.Size.ToString() + ")");

            stbMain.AppendLine("(pic size = " + picAnaglyph.Size.ToString() + ")");

            stbMain.AppendLine("(output size = " + updOutputWidth.Value +" X " + updOutputHeight.Value + " )");



            stbMain.AppendLine();

            stbMain.AppendLine("(myGeneralSize = " + myGeneralSize + ")");

            stbMain.AppendLine("(myViewAngle = " + myViewAngle + ")");

            stbMain.AppendLine("(myAltitude = " + myAltitude + ")");

            stbMain.AppendLine("(myGroundHeight = " + myGroundHeight + ")");

            stbMain.AppendLine("(myBackHeight = " + myBackHeight + ")");

            stbMain.AppendLine();



            stbMain.AppendLine();

            stbMain.AppendLine(rdoLandscapePersianGulf.Checked ? "( Persian Gulf )" : rdoLandscapeGolestanPark.Checked ? "( Golestan National Park )" : "( 3D Mix )");

            stbMain.AppendLine("( Based On : " + mnuOut1.Text + ")");

            stbMain.AppendLine("( " + mnuOut2.Text + " )");

            stbMain.AppendLine("( Overall Size = " + trbGeneralSize.Value + " )");

            stbMain.AppendLine("( Initial Size = " + trbInitialSize.Value + " )");

            stbMain.AppendLine("( Prespective = " + trbPerpective.Value + " )");

            stbMain.AppendLine("( Starting Depth = " + trbStartingDepthGeneral.Value + " )");

            stbMain.AppendLine("( View Angle = " + trbViewAngle.Value + " )");

            stbMain.AppendLine("( Altitute = " + trbAltitude.Value + " )");

            stbMain.AppendLine("( Digging = " + trbDigging.Value + " )");

            stbMain.AppendLine("( Depth Level= " + trbBaseDepth.Value + " , " + (chkDepthRandom.Checked ? "1" : "0") + " , " + updDepthRandom.Value + " )");

            stbMain.AppendLine();









            //if (chkCloudObjects.Checked)

            stbMain.AppendLine("(Cloud : " + (chkCloudObjects.Checked ? "1" : "0") + " , " + updCloudObjects.Value + " , " + trbSizeCloud.Value + " , " + trbInitialCloud.Value + " , " + trbZoomCloud.Value + " , " + trbDepthCloudsStart.Value + " , " + trbDepthCloudsMinimum.Value + " , " + trbDepthClouds.Value + " , " + trbDepthCloudsNoise.Value + " , " + updYCorrectionClouds.Value + " , " + cmbXAlineClouds.SelectedIndex + " , " + cmbCloudEffect.SelectedIndex + ") ");



            //if (chkCloudObjects.Checked)

            stbMain.AppendLine("(Fog : " + (chkFogObjects.Checked ? "1" : "0") + " , " + updFogObjects.Value + " , " + trbSizeFog.Value + " , " + trbInitialFog.Value + " , " + trbZoomFog.Value + " , " + trbDepthFogStart.Value + " , " + trbDepthFogMinimum.Value + " , " + trbDepthFog.Value + " , " + trbDepthFogNoise.Value + " , " + updYCorrectionFog.Value + " , " + cmbXAlineFog.SelectedIndex + " , " + cmbFogEffect.SelectedIndex + ") ");



            //if (chkRockObjects.Checked)

            stbMain.AppendLine("(Rock : " + (chkRockObjects.Checked ? "1" : "0") + " , " + updRockObjects.Value + " , " + trbSizeRock.Value + " , " + trbInitialRocks.Value + " , " + trbZoomRocks.Value + " , " + trbDepthRockStart.Value + " , " + trbDepthRocksMinimum.Value + " , " + trbDepthRocks.Value + " , " + trbDepthRocksNoise.Value + " , " + updYCorrectionRocks.Value + " , " + cmbXAlineRocks.SelectedIndex + " , " + cmbRockEffect.SelectedIndex + ") ");



            //if (chkBirdObjects.Checked)

            stbMain.AppendLine("(Bird : " + (chkBirdObjects.Checked ? "1" : "0") + " , " + updBirdObjects.Value + " , " + trbSizeBird.Value + " , " + trbInitialBirds.Value + " , " + trbZoomBirds.Value + " , " + trbDepthBirdsStart.Value + " , " + trbDepthBirdsMinimum.Value + " , " + trbDepthBirds.Value + " , " + trbDepthBirdsNoise.Value + " , " + updYCorrectionBirds.Value + " , " + cmbXAlineBirds.SelectedIndex + " , " + cmbBirdEffect.SelectedIndex + ") ");



            //if (chkShipObject.Checked)

            stbMain.AppendLine("(Ship : " + (chkShipObject.Checked ? "1" : "0") + " , " + updShipObjects.Value + " , " + trbSizeShip.Value + " , " + trbInitialShip.Value + " , " + trbZoomShips.Value + " , " + trbDepthShipStart.Value + " , " + trbDepthShipMinimum.Value + " , " + trbDepthShip.Value + " , " + trbDepthShipNoise.Value + " , " + updYCorrectionShips.Value + " , " + cmbXAlineShips.SelectedIndex + " , " + cmbShipEffect.SelectedIndex + ") ");



            //if (chkAnimalObjects.Checked)

            stbMain.AppendLine("(Fish : " + (chkFishObject.Checked ? "1" : "0") + " , " + updFishesObjects.Value + " , " + trbSizeFish.Value + " , " + trbInitialFishes.Value + " , " + trbZoomFishes.Value + " , " + trbDepthFishesStart.Value + " , " + trbDepthFishesMinimum.Value + " , " + trbDepthFish.Value + " , " + trbDepthFishesNoise.Value + " , " + updYCorrectionFishes.Value + " , " + cmbXAlineFishes.SelectedIndex + " , " + cmbFishEffect.SelectedIndex + ") ");



            //if (chkAnimalObjects.Checked)

            stbMain.AppendLine("(Human : " + (chkHumanObject.Checked ? "1" : "0") + " , " + updHumansObjects.Value + " , " + trbSizeHuman.Value + " , " + trbInitialHumans.Value + " , " + trbZoomHumans.Value + " , " + trbDepthHumansStart.Value + " , " + trbDepthHumansMinimum.Value + " , " + trbDepthHuman.Value + " , " + trbDepthHumansNoise.Value + " , " + updYCorrectionHumans.Value + " , " + cmbXAlineHumans.SelectedIndex + " , " + cmbHumanEffect.SelectedIndex + ") ");



            //if (chkAnimalObjects.Checked)

            stbMain.AppendLine("(Animal : " + (chkAnimalObjects.Checked ? "1" : "0") + " , " + updAnimalObjects.Value + " , " + trbSizeAnimal.Value + " , " + trbInitialAnimal.Value + " , " + trbZoomAnimals.Value + " , " + trbDepthAnimalsStart.Value + " , " + trbDepthAnimalsMinimum.Value + " , " + trbDepthAnimals.Value + " , " + trbDepthAnimalsNoise.Value + " , " + updYCorrectionAnimals.Value + " , " + cmbXAlineAnimals.SelectedIndex + " , " + cmbAnimalEffect.SelectedIndex + ") ");



            //if (chkFlowerObject.Checked)

            stbMain.AppendLine("(Flower : " + (chkFlowerObject.Checked ? "1" : "0") + " , " + updFlowerObject.Value + " , " + trbSizeFlower.Value + " , " + trbInitialFlowers.Value + " , " + trbZoomFlowers.Value + " , " + trbDepthFlowerStart.Value + " , " + trbDepthFlowerMinimum.Value + " , " + trbDepthFlower.Value + " , " + trbDepthFlowerNoise.Value + " , " + updYCorrectionFlowers.Value + " , " + cmbXAlineFlowers.SelectedIndex + " , " + cmbFlowerEffect.SelectedIndex + ") ");



            //if (chkTreeObject.Checked)

            stbMain.AppendLine("(Tree : " + (chkTreeObject.Checked ? "1" : "0") + " , " + updTreeObjects.Value + " , " + trbSizeTree.Value + " , " + trbInitialTrees.Value + " , " + trbZoomTrees.Value + " , " + trbDepthTreetart.Value + " , " + trbDepthTreeMinimum.Value + " , " + trbDepthTree.Value + " , " + trbDepthTreeNoise.Value + " , " + updYCorrectionTree.Value + " , " + cmbXAlineTree.SelectedIndex + " , " + cmbTreeEffect.SelectedIndex + ") ");



            stbMain.AppendLine();



            stbMain.AppendLine("(3D Image =  " + picBack3DSelected + ") ");

            stbMain.AppendLine("(Sky Image =  " + picSkySelected + " , " + (chkRandomSky.Checked ? "1" : "0") + " , " + cmbSkyEffect.SelectedIndex + ") ");

            stbMain.AppendLine("(Ground Image =  " + picGroundSelected + " , " + (chkRandomGround.Checked ? "1" : "0") + " , " + cmbGroundEffect.SelectedIndex + ") ");

            stbMain.AppendLine("(Water Image =  " + picWaterSelected + " , " + (chkRandomWater.Checked ? "1" : "0") + " , " + cmbWaterEffect.SelectedIndex + ") ");

            stbMain.AppendLine();



            stbMain.AppendLine("( General Effect = " + cmbGeneralEffect.SelectedIndex + ")");

            stbMain.AppendLine();





            stbMain.AppendLine("Depth = " + (-baseDepth));

            stbMain.AppendLine("Min  Depth = " + minDepth);

            stbMain.AppendLine("Max  Depth = " + maxDepth);

            stbMain.AppendLine("Mean Depth = " + meanDepth / (float)myAllPicCollection.Count);

            stbMain.AppendLine();

            stbMain.AppendLine("Objects count = " + myAllPicCollection.Count);

            stbMain.AppendLine();



            stbMain.AppendLine("[Object]");

            stbMain.AppendLine();



            stbMain.Append(stbInfo.ToString()); // add string containing each object data



            stbMain.AppendLine();

            stbMain.AppendLine();

            stbMain.AppendLine("[END]");

            stbMain.AppendLine("-----------");

            stbMain.AppendLine("[Persian Gulf Anaglyph]");

            stbMain.AppendLine("[By: Mohammad Reza Khosravi]");

            stbMain.AppendLine("[www.toorang.com]");

            stbMain.AppendLine("[ver:  1.0.3]");

            stbMain.AppendLine("-----------");

            stbMain.AppendLine(myGeneralFileName);

            stbMain.AppendLine("-----------");

            stbMain.AppendLine("#&!*@$%*");

            stbMain.AppendLine("-----------");



            stbInfo = stbMain;

        }



        private void setTitle()

        {

            myTitle = (rdoLandscapePersianGulf.Checked ? "Persian Gulf" : rdoLandscapeGolestanPark.Checked ? "Golestan Park" : "3D Mix");

            myTitle += ("_" + updOutputWidth.Value);

            myTitle += ("x" + updOutputHeight.Value);

            myTitle += ("_");

            myTitle += ("[oS" + trbGeneralSize.Value);

            myTitle += (" iS" + trbInitialSize.Value);

            myTitle += (" P" + trbPerpective.Value);

            myTitle += (" sD" + trbStartingDepthGeneral.Value);

            myTitle += (" V" + trbViewAngle.Value);

            myTitle += (" A" + trbAltitude.Value);

            myTitle += (" Y" + trbDigging.Value);

            myTitle += (" D" + (-baseDepth).ToString());

            myTitle += "] ";



            if (chkCloudObjects.Checked)

                myTitle += ("(Cd:" + updCloudObjects.Value + "_" + trbSizeCloud.Value + "_" + trbInitialCloud.Value + "_" + trbZoomCloud.Value + "_" + trbDepthCloudsStart.Value + "_" + trbDepthCloudsMinimum.Value + "_" + trbDepthClouds.Value + "_" + trbDepthCloudsNoise.Value + "_" + updYCorrectionClouds.Value + "_" + cmbXAlineClouds.SelectedIndex + "_" + cmbCloudEffect.SelectedIndex + ") ");



            if (chkFogObjects.Checked)

                myTitle += ("(Fg:" + updFogObjects.Value + "_" + trbSizeFog.Value + "_" + trbInitialFog.Value + "_" + trbZoomFog.Value + "_" + trbDepthFogStart.Value + "_" + trbDepthFogMinimum.Value + "_" + trbDepthFog.Value + "_" + trbDepthFogNoise.Value + "_" + updYCorrectionFog.Value + "_" + cmbXAlineFog.SelectedIndex + "_" + cmbFogEffect.SelectedIndex + ") ");



            if (chkRockObjects.Checked)

                myTitle += ("(Rk:" + updRockObjects.Value + "_" + trbSizeRock.Value + "_" + trbInitialRocks.Value + "_" + trbZoomRocks.Value + "_" + trbDepthRockStart.Value + "_" + trbDepthRocksMinimum.Value + "_" + trbDepthRocks.Value + "_" + trbDepthRocksNoise.Value + "_" + updYCorrectionRocks.Value + "_" + cmbXAlineRocks.SelectedIndex + "_" + cmbRockEffect.SelectedIndex + ") ");



            if (chkBirdObjects.Checked)

                myTitle += ("(Bd:" + updBirdObjects.Value + "_" + trbSizeBird.Value + "_" + trbInitialBirds.Value + "_" + trbZoomBirds.Value + "_" + trbDepthBirdsStart.Value + "_" + trbDepthBirdsMinimum.Value + "_" + trbDepthBirds.Value + "_" + trbDepthBirdsNoise.Value + "_" + updYCorrectionBirds.Value + "_" + cmbXAlineBirds.SelectedIndex + "_" + cmbBirdEffect.SelectedIndex + ") ");



            if (chkShipObject.Checked)

                myTitle += ("(Sh:" + updShipObjects.Value + "_" + trbSizeShip.Value + "_" + trbInitialShip.Value + "_" + trbZoomShips.Value + "_" + trbDepthShipStart.Value + "_" + trbDepthShipMinimum.Value + "_" + trbDepthShip.Value + "_" + trbDepthShipNoise.Value + "_" + updYCorrectionShips.Value + "_" + cmbXAlineShips.SelectedIndex + "_" + cmbShipEffect.SelectedIndex + ") ");



            if (chkFishObject.Checked)

                myTitle += ("(Fs:" + updFishesObjects.Value + "_" + trbSizeFish.Value + "_" + trbInitialFishes.Value + "_" + trbZoomFishes.Value + "_" + trbDepthFishesStart.Value + "_" + trbDepthFishesMinimum.Value + "_" + trbDepthFish.Value + "_" + trbDepthFishesNoise.Value + "_" + updYCorrectionFishes.Value + "_" + cmbXAlineFishes.SelectedIndex + "_" + cmbFishEffect.SelectedIndex + ") ");



            if (chkHumanObject.Checked)

                myTitle += ("(Hm:" + updHumansObjects.Value + "_" + trbSizeHuman.Value + "_" + trbInitialHumans.Value + "_" + trbZoomHumans.Value + "_" + trbDepthHumansStart.Value + "_" + trbDepthHumansMinimum.Value + "_" + trbDepthHuman.Value + "_" + trbDepthHumansNoise.Value + "_" + updYCorrectionHumans.Value + "_" + cmbXAlineHumans.SelectedIndex + "_" + cmbHumanEffect.SelectedIndex + ") ");



            if (chkAnimalObjects.Checked)

                myTitle += ("(An:" + updAnimalObjects.Value + "_" + trbSizeAnimal.Value + "_" + trbInitialAnimal.Value + "_" + trbZoomAnimals.Value + "_" + trbDepthAnimalsStart.Value + "_" + trbDepthAnimalsMinimum.Value + "_" + trbDepthAnimals.Value + "_" + trbDepthAnimalsNoise.Value + "_" + updYCorrectionAnimals.Value + "_" + cmbXAlineAnimals.SelectedIndex + "_" + cmbAnimalEffect.SelectedIndex + ") ");



            if (chkFlowerObject.Checked)

                myTitle += ("(Fw:" + updFlowerObject.Value + "_" + trbSizeFlower.Value + "_" + trbInitialFlowers.Value + "_" + trbZoomFlowers.Value + "_" + trbDepthFlowerStart.Value + "_" + trbDepthFlowerMinimum.Value + "_" + trbDepthFlower.Value + "_" + trbDepthFlowerNoise.Value + "_" + updYCorrectionFlowers.Value + "_" + cmbXAlineFlowers.SelectedIndex + "_" + cmbFlowerEffect.SelectedIndex + ") ");



            if (chkTreeObject.Checked)

                myTitle += ("(Tr:" + updTreeObjects.Value + "_" + trbSizeTree.Value + "_" + trbInitialTrees.Value + "_" + trbZoomTrees.Value + "_" + trbDepthTreetart.Value + "_" + trbDepthTreeMinimum.Value + "_" + trbDepthTree.Value + "_" + trbDepthTreeNoise.Value + "_" + updYCorrectionTree.Value + "_" + cmbXAlineTree.SelectedIndex + "_" + cmbTreeEffect.SelectedIndex + ") ");



            myTitle += ("(S" + cmbSkyEffect.SelectedIndex + "_" + "G" + cmbGroundEffect.SelectedIndex + "_" + "W" + cmbWaterEffect.SelectedIndex + ")");



            this.Text = ("Anaglyph " + myTitle);

            Debug.Print(this.Text);

            Application.DoEvents();



        }









        private void saveData(StringBuilder stbData)

        {

            try

            {

                DirectoryInfo myFileDir = new DirectoryInfo(Application.StartupPath + "\\Save\\Data\\");

                if (myFileDir.Exists)

                {



                    string fullName = myFileDir.FullName + "Anaglyph_" + myGeneralFileName;



                    fullName = (fullName.Length > 240 ? fullName.Substring(0, 240) : fullName) + ".pga";

                    using (StreamWriter outfile = new StreamWriter(fullName))

                    {

                        outfile.Write(stbData.ToString());

                    }



                }

            }

            catch (Exception ex)

            {

                Debug.WriteLine(ex.Message);

            }

        }



        private void mnuSave_Click(object sender, EventArgs e)

        {

            ImageSave();

        }



        private void ImageSave()

        {

            try

            {

                string fullName = Application.StartupPath + "\\Save\\" + "Anaglyph_" + myGeneralFileName;

                fullName = (fullName.Length > 240 ? fullName.Substring(0, 240) : fullName) + (MyDefaultImageFormat == 1 ? ".png" : ".jpg");



                ImageSave2(fullName, MyDefaultImageFormat);

            }

            catch (Exception ex)

            {

                Debug.WriteLine(ex.Message);

            }



        }



        private void mnuSaveAs_Click(object sender, EventArgs e)

        {

            bool timerStatus = tmrNext.Enabled;

            tmrNext.Enabled = false;



            saveFileDialog1.FileName = "Anaglyph_" + myGeneralFileName;

            saveFileDialog1.Filter = "PNG|*.png|JPG|*.jpg";

            saveFileDialog1.RestoreDirectory = true;

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)

            {

                try

                {

                    ImageSave2(saveFileDialog1.FileName, saveFileDialog1.FilterIndex);

                }

                catch (Exception ex)

                {

                    MessageBox.Show(ex.Message);

                }



            }

            tmrNext.Enabled = timerStatus;

        }



        private void ImageSave2(string fileName, int extension)

        {



            try

            {

                bmpAnaglyph.Save(fileName, (extension == 1 ? ImageFormat.Png : ImageFormat.Jpeg));



                if (mnuSaveLeftRightImages.Checked) // save also left and right images

                {

                    leftBitmap.Save(fileName + "_Left" + (extension == 1 ? ".png" : ".jpg"), (extension == 1 ? ImageFormat.Png : ImageFormat.Jpeg));

                    rightBitmap.Save(fileName + "_Right" + (extension == 1 ? ".png" : ".jpg"), (extension == 1 ? ImageFormat.Png : ImageFormat.Jpeg));

                }



                if (mnuSaveRedCyanImages.Checked) // save also red and cyan images

                {

                    redBitmap.Save(fileName + "__Red" + (extension == 1 ? ".png" : ".jpg"), (extension == 1 ? ImageFormat.Png : ImageFormat.Jpeg));

                    cyanBitmap.Save(fileName + "__Cyan" + (extension == 1 ? ".png" : ".jpg"), (extension == 1 ? ImageFormat.Png : ImageFormat.Jpeg));

                }



                mnuSaveFast.Enabled = false;

            }

            catch (Exception e)

            {

                MessageBox.Show(e.Message);

            }

        }



        private void saveImageFormatToolStripMenuItem_Click(object sender, EventArgs e)

        {

            switch (((ToolStripMenuItem)sender).Tag.ToString())

            {

                case "jpg":

                    MyDefaultImageFormat = 0;

                    mnuSaveJPGFormat.Checked = true;

                    mnuSavePNGFormat.Checked = false;

                    mnuSaveFast.Text = " Save (jpg) ";

                    break;

                case "png":

                    MyDefaultImageFormat = 1;

                    mnuSavePNGFormat.Checked = true;

                    mnuSaveJPGFormat.Checked = false;

                    mnuSaveFast.Text = " Save (png) ";

                    break;

                //case "bmp":

                //    MyDefaultImageFormat = 2;

                //    break;

            }

            mnuSaveFast.Enabled = true;

        }





        #endregion





        #region Predefined Samples



        private void mnuItem_Click(object sender, EventArgs e)

        {

            try

            {

                myObjectsOrientation = 0;

                runMenuItem(((ToolStripItem)sender));

            }

            catch (Exception ex)

            { Debug.WriteLine(ex.Message); }

        }





        private void runMenuItem(ToolStripItem myMenuItemSelected)

        {



            mnuOut1.Text = " -- " + myMenuItemSelected.Text + " -- ";

            bool noRun = false;

            switch (myMenuItemSelected.Name)

            {



                case "mnuResetToZero":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        1, 0, 0, 0, 1, 10,          //General Info

                        0, 0, 0, 0,

                        1, 1, 1,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Cloud

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Fog

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Ships

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Fishes

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Flowers

                        1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         ////

                        1, 10,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    chkAutoRefresh.Checked = false;

                    chkAutoRun.Checked = false;

                    cmbGeneralEffect.SelectedIndex = 0;

                    updOutputWidth.Value = 1920;

                    updOutputHeight.Value = 1080;

                    noRun = true;

                    break;



                case "mnuResetToDefault":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        50, 10, 20, 0, 35, 50,        //General Info

                        0, 0, 0, 0,

                        80, 1, 40,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 200, 20, 50, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 50, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      //Fog

                        1, 100, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 30, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 20, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 5, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      //Fishes

                        1, 5, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 20, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 100, 20, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 10, 40, 0, 0, 0, 0, 20, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 50,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,            //Water image

                        0, 1, 0, 0, 0);

                    chkAutoRun.Checked = false;

                    chkAutoRefresh.Checked = false;

                    cmbGeneralEffect.SelectedIndex = 0;

                    updOutputWidth.Value = 1920;

                    updOutputHeight.Value = 1080;

                    noRun = true;

                    break;



                ///////////////////////////////////////////////////////////////////////////////////////////////////

                ///////////////////////////////////////////////////////////////////////////////////////////////////

                case "mnuPersianGulfDefault":

                case "mnuPersianGulfBinocular":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        40, 10, 20, 0, 45, 15,         //General Info

                        0, 0, 0, 0,

                        20, 1, 5,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 200, 20, 68, 10, 0, 120, 60, 35, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 30, 60, 15, 15, 30, 100, 55, 50, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 300, 30, 0, -40, 0, 60, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 40, 32, 0, 0, 0, 10, 60, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 5, 50, 45, -15, 10, 300, 100, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 5, 20, 5, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 60,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuPersianGulfBirdsView":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        20, 10, 0, 0, 50, 160,         //General Info

                        0, 0, 0, 0,

                         160, 1, 20,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 70, 40, 35, 126, 0, 100, 50, 40, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 70, 110, 25, 5, 0, 20, 10, 40, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 200, 50, 0, -80, 1, 30, 100, 50, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 20, 55, 15, 0, 80, 30, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 20, 25, 5, 5, 0, 0, 23, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 10, 20, 5, 5, 1, 0, 30, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 30,              //Snow

                         0, 0, 0, 0, 0, 0, 0, 0,

                       0, 1,              //Sky image

                         0, 0, 0, 0, 0, 0, 0, 0,

                       0, 1,              //Ground image

                         0, 0, 0, 0, 0, 0, 0, 0,

                       0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuPersianGulfHormozStrait":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        80, 5, 20, 0, 85, 95,         //General Info

                        0, 0, 0, 0,

                         60, 1, 20,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 200, 25, 65, 35, 0, 0, 85, 55, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 50, 65, 40, 10, 0, 10, 5, 8, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 300, 30, 5, -35, 3, 5, 8, 50, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 25, 18, 0, 10, 0, 10, 30, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 30, 60, 5, 60, 0, 10, 40, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 10, 60, 5, 35, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 60,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuPersianGulfBottomView":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        40, 10, 20, 0, 80, 20,        //General Info

                        0, 0, 0, 0,

                        50, 1, 30,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 100, 20, 59, -5, -10, 100, 40, 30, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 40, 60, 70, -80, 0, 20, 10, 11, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 30, 10, -10, 0, 0, 15, 50, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 30, 25, 0, 0, 0, 10, 15, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                       1, 35, 30, 0, 10, 0, 0, 60, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 10, 20, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 50,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuPersianGulfBottomView2":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        25, 10, 20, 0, 60, 7,         //General Info

                        0, 0, 0, 0,

                        70, 1, 10,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                        1, 200, 20, 60, 0, 0, 20, 65, 20, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 60, 60, 40, -80, 0, 10, 0, 0, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 10, 0, -10, 0, 0, 10, 50, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 40, 10, 0, 0, 0, 10, 70, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 5, 28, 5, 10, 10, 170, 200, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 10, 30, 0, 10, 0, 8, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                       1, 60,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuPersianGulfOpenSea":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        30, 10, 20, 0, 100, 22,         //General Info

                        0, 0, 0, 0,

                        50, 1, 20,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 150, 25, 60, 20, 0, 0, 45, 35, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 10, 20, 10, -10, 90, 300, 162, 90, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 10, 0, 0, 0, 0, 10, 50, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 20, 15, 0, 0, 0, 20, 15, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 15, 35, 0, 25, 0, 5, 24, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 8, 40, 0, 25, 30, 100, 55, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 40,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                         0, 0, 0, 0, 0, 0, 0, 0,

                       0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuPersianGulfOpenSea2":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        40, 10, 20, 0, 1, 10,        //General Info

                        0, 0, 0, 0,

                        100, 1, 70,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 200, 25, 77, -5, 0, 30, 20, 30, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 80, 25, 30, 0, 0, 5, 0, 5, 20, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 50, 15, 0, 0, 0, 0, 25, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 5, 40, 5, 20, 3, 35, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 20, 35, 0, 15, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 50,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuPersianGulfSeaLine":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        50, 10, 20, 0, 70, 40,          //General Info

                        0, 0, 0, 0,

                        35, 1, 5,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 100, 20, 65, -5, 0, 25, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 40, 70, 30, -60, 80, 90, 15, 30, 0, 15, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                       1, 150, 4, 0, -90, 50, 155, 60, 25, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 10, 25, 0, 10, 40, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 10, 35, 5, 10, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 20, 35, 0, 15, 15, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 40,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        0, 1, 0, 0, 0);

                    break;

                ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



                case "mnuGolestanParkDefault":

                case "mnuGolestanParkDangerZone":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        20, 10, 20, 0, 80, 20,         //General Info

                        0, 0, 0, 0,

                        10, 1, 7,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 150, 30, 55, -5, 0, 50, 3, 65, 0, 50, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 25, 60, 30, 0, 0, 50, 0, 0, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 40, 0, 0, 0, 15, 15, 55, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 20, 40, 0, 0, 0, 40, 5, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 20, 20, 0, 0, 0, 10, 80, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 300, 16, 0, 0, 0, 5, 40, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 60, 55, 0, 0, 0, 10, 50, 50, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 60,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuGolestanParkOnTheTree":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        35, 5, 20, 0, 70, 245,        //General Info

                        0, 0, 0, 0,

                        170, 1, 20,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 100, 40, 50, 0, 0, 5, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 50, 80, 50, -10, 0, 0, 20, 40, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 140, 50, 30, -40, 0, 0, 15, 40, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 20, 50, 0, 15, 0, 5, 95, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 30, 15, 0, 15, 1, 2, 5, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Human

                        1, 100, 15, 0, 15, 1, 1, 5, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 100, 10, 0, 0, 0, 20, 10, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 310, 55, 7, 10, 0, 0, 25, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 60,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuGolestanParkNoFear":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                       15, 5, 15, 0, 100, 115,          //General Info

                        0, 0, 0, 0,

                        35, 1, 5,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                       1, 50, 45, 71, 15, 0, 10, 25, 8, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                       1, 130, 60, 50, 30, 15, 0, 110, 0, 20, 2, 98, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                       1, 20, 55, 10, -45, 2, 10, 10, 75, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                       1, 30, 60, 0, 30, 0, 5, 40, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 20, 30, 0, 20, 0, 5, 50, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 50, 30, 0, 20, 0, 5, 60, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 200, 10, 0, 30, 0, 10, 90, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 100, 85, 0, 30, 0, 5, 15, 15, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 50,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuGolestanParkOnTheGround":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        25, 10, 20, 0, 5, 25,        //General Info

                        0, 0, 0, 0,

                        50, 1, 25,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 200, 40, 50, 0, 0, 0, 20, 50, 0, 50, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 100, 80, 60, 35, 0, 5, 5, 10, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 200, 40, 0, 0, 0, 0, 30, 50, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 20, 55, 0, 0, 0, 5, 25, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 10, 20, 0, 0, 0, 0, 25, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                       1, 40, 20, 0, 5, 0, 0, 25, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                       1, 200, 15, 0, 15, 0, 30, 40, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 50, 55, 0, 10, 0, 0, 30, 50, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                       1, 40,              //Snow

                         0, 0, 0, 0, 0, 0, 0, 0,

                       0, 1,               //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuGolestanParkLayDown":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        25, 10, 20, 0, 100, 15,        //General Info

                        0, 0, 0, 0,

                        130, 1, 20,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                        1, 100, 30, 60, 20, 0, 2, 0, 0, 0, 50, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 20, 40, 25, 0, 0, 10, 0, 0, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 30, 0, 0, 0, 0, 5, 40, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 10, 25, 0, 10, 0, 0, 15, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 5, 10, 0, 10, 0, 0, 35, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 40, 10, 0, 10, 0, 0, 35, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 160, 12, 0, 15, 0, 20, 65, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 50, 55, 0, 10, 0, 0, 30, 55, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 40,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuGolestanParkFlowerBouquet":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        25, 10, 20, 0, 95, 15,         //General Info

                        0, 0, 0, 0,

                        15, 1, 2,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 60, 20, 60, 0, 0, 15, 1, 50, 0, 50, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 20, 40, 20, 20, 0, 10, 0, 0, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 40, 0, 0, 0, 5, 5, 30, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 30, 25, 0, 0, 0, 25, 15, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 40, 20, 0, 3, 0, 0, 16, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 400, 12, 0, 15, 0, 500, 65, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 30, 55, 0, 0, 0, 0, 30, 55, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 60,              //Snow

                         0, 0, 0, 0, 0, 0, 0, 0,

                       0, 1,               //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuGolestanParkToday":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        15, 5, 15, 0, 85, 30,         //General Info

                        0, 0, 0, 0,

                        150, 1, 20,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                        1, 100, 45, 60, 0, 0, 15, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 50, 60, 35, 10, 0, 5, 0, 0, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 60, 40, 0, 0, 7, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 30, 40, 0, 10, 0, 10, 20, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 10, 15, 0, 0, 25, 40, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 15, 15, 0, 10, 2, 15, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 300, 5, 0, 25, 5, 10, 100, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 2, 35, 0, 0, 8, 5, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 30,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,               //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        3, 0,               //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////

                /////////////////////////////////////////////////////////////////////////////////////////////////

                case "mnuSpecialEffectGolestanWinter":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        20, 10, 30, 0, 20, 50,          //General Info

                        0, 0, 0, 0,

                        45, 1, 10,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                        1, 100, 45, 85, -16, 0, 10, 10, 20, 0, 50, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 30, 60, 35, -10, 10, 10, 0, 3, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 300, 40, 20, -30, 0, 5, 35, 60, 0, 50, 23, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 20, 55, 0, 5, 0, 5, 25, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 40, 20, 0, 5, 0, 0, 35, 50, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 250, 20, 0, 0, 0, 10, 50, 60, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 50, 55, 20, 10, 0, 0, 25, 30, 0, 2, 17, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 60,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 20,               //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 17,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,               //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuSpecialEffectColdWay":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        15, 10, 20, 0, 50, 20,          //General Info

                        0, 0, 0, 0,

                        80, 1, 10,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                        1, 300, 40, 75, -45, 0, 0, 40, 60, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 30, 110, 55, 40, 0, 5, 0, 0, 0, 2, 91, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 55, 0, 0, 0, 10, 30, 30, 0, 42, 23, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 20, 55, 0, 0, 0, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 5, 65, 0, -45, 15, 10, 40, 20, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 350, 20, 0, 0, 0, 10, 90, 60, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 50,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 20,               //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 17,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,               //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuSpecialEffectArctic":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        15, 10, 20, 0, 45, 30,         //General Info

                        0, 0, 0, 0,

                        100, 1, 10,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                        1, 400, 50, 75, 0, 0, 70, 65, 45, 0, 15, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 70, 60, 20, 0, 0, 10, 20, 0, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 20, 10, -40, 0, 15, 30, 0, 0, 9, 22, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 25, 30, 0, 0, 0, 0, 40, 30, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 7, 55, 0, 40, 0, 5, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 5, 55, 10, 50, 5, 40, 24, 45, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 50,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 21,               //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 22,               //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuSpecialEffectGolestanEarlyMorning":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        25, 30, 25, 0, 21, 20,         //General Info

                        0, 0, 0, 0,

                        20, 1, 5,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                       1, 30, 45, 74, 5, 0, 60, 10, 10, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 15, 60, 45, 0, 63, 424, 5, 0, 50, 2, 93, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 300, 60, 20, 0, 0, 40, 0, 0, 0, 42, 96, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 5, 110, 10, 30, 0, 10, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 2, 25, 0, -15, 40, 110, 60, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 300, 10, 0, 0, 0, 20, 40, 70, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 25, 90, 30, 0, 0, 40, 20, 0, 0, 2, 30, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 20,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 24,               //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 31,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,               //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuSpecialEffectDarkSea":

                    putInfo(0,              //0=Persian Gulf   1=Golestan Park

                        20, 10, 20, 0, 45, 35,         //General Info

                        0, 0, 0, 0,

                        90, 1, 20,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                       1, 100, 60, 70, -20, 0, 20, 50, 70, 0, 2, 31, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 50, 130, 60, -40, 0, 0, 20, 30, 0, 2, 97, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 30, 5, 0, 0, 0, 10, 50, 0, 21, 30, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        1, 5, 58, 5, 80, 0, 20, 105, 78, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        1, 10, 35, 0, 20, 0, 8, 10, 10, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 20,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 31,               //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 31,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 31,               //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuSpecialEffectNightHill":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        20, 5, -50, 0, 85, 190,          //General Info

                        0, 0, 0, 0,

                        50, 1, 10,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                       1, 20, 60, 60, 5, 0, 5, 0, 0, 0, 2, 96, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 40, 100, 60, 0, 0, 10, 0, 0, 0, 22, 97, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 20, 105, 5, 0, 0, 0, 60, 50, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                       1, 10, 130, 5, 0, 0, 0, 55, 50, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 100, 40, 0, -40, 0, 20, 20, 90, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 70, 200, 80, -55, 0, 5, 65, 40, 0, 44, 43, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 30,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 32,              //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 31,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuSpecialEffectAvatarNights":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        25, 5, 15, 0, 5, 35,          //General Info

                        0, 0, 0, 0,

                        50, 1, 10,            //Depth Control

                         0, 0, 0, 0, 0, 0,

                       1, 50, 50, 0, 0, 0, 0, 11, 30, 0, 50, 96, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 15, 130, 50, 0, 0, 5, 16, 0, 0, 2, 97, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 100, 15, 1, 0, 3, 20, 40, 50, 0, 50, 82, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                       1, 25, 40, 0, 0, 0, 0, 65, 50, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 500, 55, 5, -5, 0, 15, 75, 85, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 50, 70, 15, 0, 0, 0, 30, 10, 0, 2, 43, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 10,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 32,              //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 31,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                case "mnuSpecialEffectLiliput":

                    putInfo(1,              //0=Persian Gulf   1=Golestan Park

                        70, 0, 10, 0, 70, 40,         //General Info

                        10, 0, 0, 0,

                        120, 1, 10,            //Depth Control

                        0, 0, 0, 0, 0, 0,

                       1, 100, 50, 60, 0, 0, 2, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 25, 105, 28, 45, 0, 2, 0, 5, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,       //Fog

                        1, 80, 90, 0, 0, -5, 8, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Rocks

                        1, 2, 155, 30, 0, 0, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                       1, 10, 10, 1, -5, 2, 30, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                       1, 2, 70, 40, -15, 1, 10, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 180, 100, 15, -10, 0, 0, 70, 55, 0, 2, 35, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 5, 80, 5, 0, 1, 10, 5, 5, 0, 15, 36, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 20,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 40,               //Sky image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 40,               //Ground image

                        0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,              //Water image

                        0, 1, 0, 0, 0);

                    break;

                /////////////////////////////////////////////////////////////////////////////////

                ////////////////////////////////////////////////////////////////////////////////

                case "mnuMix3dDesert":

                    putInfo(2,                          //0=Persian Gulf,   1=Golestan Park,  2=3D image

                        20, 0, 0, -10, 67, 57,         //General Info

                        0, 0, 0, 0,

                        55, 0, 5,                     //Depth Control

                        0, 0, 0, 0, 0, 0,

                        0, 200, 30, 70, 5, 30, 10, 40, 20, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        0, 50, 40, 40, -20, 30, 20, 50, 70, -100, 5, 98, 0, 0, 0, 0, 0, 0, 0, 0,             //Fog

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,             //Rocks

                        1, 5, 45, 40, 10, -10, 5, 0, 0, -100, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,      //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 3, 40, 35, 15, 10, 30, 90, 45, 10, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 2, 43, 40, 20, 30, 30, 90, 45, 5, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 30, 10, 0, 70, 55, 20, 45, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        0, 5, 20, 0, 30, 60, 0, 20, 0, 80, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 30,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        3, 1, 0, 0,          //3D image

                        0);

                    break;

                case "mnuMix3dGalikesh":

                    putInfo(2,                          //0=Persian Gulf,   1=Golestan Park,  2=3D image

                        20, 0, 0, 0, 89, 38,         //General Info

                        0, 0, 0, 0,

                        80, 0, 5,                     //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 200, 30, 70, 5, 30, 10, 40, 20, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        1, 50, 40, 40, -20, 30, 20, 50, 70, -100, 5, 98, 0, 0, 0, 0, 0, 0, 0, 0,             //Fog

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,             //Rocks

                        1, 10, 20, 5, 20, 40, 10, 20, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,      //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 5, 2, 0, 78, 45, 20, 45, 10, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        1, 2, 3, 0, 70, 70, 20, 60, 30, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        1, 30, 15, 0, 40, 60, 10, 10, 0, 30, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 5, 20, 0, 30, 60, 0, 20, 0, 80, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 30,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        2, 1, 0, 0,          //3D image

                        0);

                    break;

                case "mnuMix3dFarsian":

                    putInfo(2,                          //0=Persian Gulf,   1=Golestan Park,  2=3D image

                        20, 10, 0, 0, 50, 75,         //General Info

                        0, 0, 0, 0,

                        25, 0, 5,                     //Depth Control

                        0, 0, 0, 0, 0, 0,

                        1, 90, 55, 65, 26, 20, 100, 30, 40, 0, 13, 88, 0, 0, 0, 0, 0, 0, 0, 0,     //Clouds

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,             //Fog

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,             //Rocks

                        1, 10, 5, 5, 100, 50, 50, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      //Bird

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Ships

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          //Fishes

                        1, 3, 40, 10, -5, 100, 0, 40, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Humans

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         //Animals

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Flowers

                        1, 2, 65, 25, 0, 80, 40, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,        //Trees

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        ////

                        1, 30,              //Snow

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Sky image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1,              //Ground image

                        0, 0, 0, 0, 0, 0, 0, 0,

                        0, 1, 0,             //Water image

                        1, 1, 0, 0,          //3D image

                        0);

                    break;



            }



            Application.DoEvents();

            if (!noRun && mnuRunAfterSampleSelection.Checked) goRun(false);

        }













        private void putInfo(params int[] infoArray)

        {

            if (infoArray[0] == 0) rdoLandscapePersianGulf.Checked = true;

            else if (infoArray[0] == 1) rdoLandscapeGolestanPark.Checked = true;

            else rdoLandscape3D.Checked = true;





            trbGeneralSize.Value = infoArray[1];

            trbInitialSize.Value = infoArray[2];

            trbPerpective.Value = infoArray[3];

            trbStartingDepthGeneral.Value = infoArray[4];

            trbViewAngle.Value = infoArray[5];

            trbAltitude.Value = infoArray[6];

            trbDigging.Value = infoArray[7];







            trbBaseDepth.Value = infoArray[11];

            chkDepthRandom.Checked = Convert.ToBoolean(infoArray[12]);

            if (chkDepthRandom.Checked) updDepthRandom.Value = infoArray[13];





            chkCloudObjects.Checked = Convert.ToBoolean(infoArray[20]);

            if (chkCloudObjects.Checked)

            {

                updCloudObjects.Value = infoArray[21];

                trbSizeCloud.Value = infoArray[22];

                trbInitialCloud.Value = infoArray[23];

                trbZoomCloud.Value = infoArray[24];

                trbDepthCloudsStart.Value = infoArray[25];

                trbDepthCloudsMinimum.Value = infoArray[26];

                trbDepthClouds.Value = infoArray[27];

                trbDepthCloudsNoise.Value = infoArray[28];

                updYCorrectionClouds.Value = infoArray[29];

                cmbXAlineClouds.SelectedIndex = infoArray[30];

                cmbCloudEffect.SelectedIndex = infoArray[31];



            }



            chkFogObjects.Checked = Convert.ToBoolean(infoArray[40]);

            if (chkFogObjects.Checked)

            {

                updFogObjects.Value = infoArray[41];

                trbSizeFog.Value = infoArray[42];

                trbInitialFog.Value = infoArray[43];

                trbZoomFog.Value = infoArray[44];

                trbDepthFogStart.Value = infoArray[45];

                trbDepthFogMinimum.Value = infoArray[46];

                trbDepthFog.Value = infoArray[47];

                trbDepthFogNoise.Value = infoArray[48];

                updYCorrectionFog.Value = infoArray[49];

                cmbXAlineFog.SelectedIndex = infoArray[50];

                cmbFogEffect.SelectedIndex = infoArray[51];

            }



            chkRockObjects.Checked = Convert.ToBoolean(infoArray[60]);

            if (chkRockObjects.Checked)

            {

                updRockObjects.Value = infoArray[61];

                trbSizeRock.Value = infoArray[62];

                trbInitialRocks.Value = infoArray[63];

                trbZoomRocks.Value = infoArray[64];

                trbDepthRockStart.Value = infoArray[65];

                trbDepthRocksMinimum.Value = infoArray[66];

                trbDepthRocks.Value = infoArray[67];

                trbDepthRocksNoise.Value = infoArray[68];

                updYCorrectionRocks.Value = infoArray[69];

                cmbXAlineRocks.SelectedIndex = infoArray[70];

                cmbRockEffect.SelectedIndex = infoArray[71];

            }



            chkBirdObjects.Checked = Convert.ToBoolean(infoArray[80]);

            if (chkBirdObjects.Checked)

            {

                updBirdObjects.Value = infoArray[81];

                trbSizeBird.Value = infoArray[82];

                trbInitialBirds.Value = infoArray[83];

                trbZoomBirds.Value = infoArray[84];

                trbDepthBirdsStart.Value = infoArray[85];

                trbDepthBirdsMinimum.Value = infoArray[86];

                trbDepthBirds.Value = infoArray[87];

                trbDepthBirdsNoise.Value = infoArray[88];

                updYCorrectionBirds.Value = infoArray[89];

                cmbXAlineBirds.SelectedIndex = infoArray[90];

                cmbBirdEffect.SelectedIndex = infoArray[91];

            }



            chkShipObject.Checked = Convert.ToBoolean(infoArray[100]);

            if (chkShipObject.Checked)

            {

                updShipObjects.Value = infoArray[101];

                trbSizeShip.Value = infoArray[102];

                trbInitialShip.Value = infoArray[103];

                trbZoomShips.Value = infoArray[104];

                trbDepthShipStart.Value = infoArray[105];

                trbDepthShipMinimum.Value = infoArray[106];

                trbDepthShip.Value = infoArray[107];

                trbDepthShipNoise.Value = infoArray[108];

                updYCorrectionShips.Value = infoArray[109];

                cmbXAlineShips.SelectedIndex = infoArray[110];

                cmbShipEffect.SelectedIndex = infoArray[111];

            }



            chkFishObject.Checked = Convert.ToBoolean(infoArray[120]);

            if (chkFishObject.Checked)

            {

                updFishesObjects.Value = infoArray[121];

                trbSizeFish.Value = infoArray[122];

                trbInitialFishes.Value = infoArray[123];

                trbZoomFishes.Value = infoArray[124];

                trbDepthFishesStart.Value = infoArray[125];

                trbDepthFishesMinimum.Value = infoArray[126];

                trbDepthFish.Value = infoArray[127];

                trbDepthFishesNoise.Value = infoArray[128];

                updYCorrectionFishes.Value = infoArray[129];

                cmbXAlineFishes.SelectedIndex = infoArray[130];

                cmbFishEffect.SelectedIndex = infoArray[131];

            }



            chkHumanObject.Checked = Convert.ToBoolean(infoArray[140]);

            if (chkHumanObject.Checked)

            {

                updHumansObjects.Value = infoArray[141];

                trbSizeHuman.Value = infoArray[142];

                trbInitialHumans.Value = infoArray[143];

                trbZoomHumans.Value = infoArray[144];

                trbDepthHumansStart.Value = infoArray[145];

                trbDepthHumansMinimum.Value = infoArray[146];

                trbDepthHuman.Value = infoArray[147];

                trbDepthHumansNoise.Value = infoArray[148];

                updYCorrectionHumans.Value = infoArray[149];

                cmbXAlineHumans.SelectedIndex = infoArray[150];

                cmbHumanEffect.SelectedIndex = infoArray[151];

            }



            chkAnimalObjects.Checked = Convert.ToBoolean(infoArray[160]);

            if (chkAnimalObjects.Checked)

            {

                updAnimalObjects.Value = infoArray[161];

                trbSizeAnimal.Value = infoArray[162];

                trbInitialAnimal.Value = infoArray[163];

                trbZoomAnimals.Value = infoArray[164];

                trbDepthAnimalsStart.Value = infoArray[165];

                trbDepthAnimalsMinimum.Value = infoArray[166];

                trbDepthAnimals.Value = infoArray[167];

                trbDepthAnimalsNoise.Value = infoArray[168];

                updYCorrectionAnimals.Value = infoArray[169];

                cmbXAlineAnimals.SelectedIndex = infoArray[170];

                cmbAnimalEffect.SelectedIndex = infoArray[171];

            }



            chkFlowerObject.Checked = Convert.ToBoolean(infoArray[180]);

            if (chkFlowerObject.Checked)

            {

                updFlowerObject.Value = infoArray[181];

                trbSizeFlower.Value = infoArray[182];

                trbInitialFlowers.Value = infoArray[183];

                trbZoomFlowers.Value = infoArray[184];

                trbDepthFlowerStart.Value = infoArray[185];

                trbDepthFlowerMinimum.Value = infoArray[186];

                trbDepthFlower.Value = infoArray[187];

                trbDepthFlowerNoise.Value = infoArray[188];

                updYCorrectionFlowers.Value = infoArray[189];

                cmbXAlineFlowers.SelectedIndex = infoArray[190];

                cmbFlowerEffect.SelectedIndex = infoArray[191];

            }



            chkTreeObject.Checked = Convert.ToBoolean(infoArray[200]);

            if (chkTreeObject.Checked)

            {

                updTreeObjects.Value = infoArray[201];

                trbSizeTree.Value = infoArray[202];

                trbInitialTrees.Value = infoArray[203];

                trbZoomTrees.Value = infoArray[204];

                trbDepthTreetart.Value = infoArray[205];

                trbDepthTreeMinimum.Value = infoArray[206];

                trbDepthTree.Value = infoArray[207];

                trbDepthTreeNoise.Value = infoArray[208];

                updYCorrectionTree.Value = infoArray[209];

                cmbXAlineTree.SelectedIndex = infoArray[210];

                cmbTreeEffect.SelectedIndex = infoArray[211];

            }



            chkSnowObjects.Checked = Convert.ToBoolean(infoArray[260]);

            if (chkSnowObjects.Checked)

            {

                trbSnow.Value = infoArray[261];

            }



            if (infoArray[270] > 0)

            {

                picSkySelected = infoArray[270] - 1;

                picSky.BackgroundImage = picsAll[myObjectTypes.Sky.GetHashCode()][picSkySelected];

            }

            chkRandomSky.Checked = Convert.ToBoolean(infoArray[271]);

            cmbSkyEffect.SelectedIndex = infoArray[272];



            if (infoArray[280] > 0)

            {

                picGroundSelected = infoArray[280] - 1;

                picGround.BackgroundImage = picsAll[myObjectTypes.Ground.GetHashCode()][picGroundSelected];

            }

            chkRandomGround.Checked = Convert.ToBoolean(infoArray[281]);

            cmbGroundEffect.SelectedIndex = infoArray[282];



            if (infoArray[290] > 0)

            {

                picWaterSelected = infoArray[290] - 1;

                picWater.BackgroundImage = picsAll[myObjectTypes.Water.GetHashCode()][picWaterSelected];

            }

            chkRandomWater.Checked = Convert.ToBoolean(infoArray[291]);

            cmbWaterEffect.SelectedIndex = infoArray[292];





            if (infoArray[293] > 0)

            {

                picBack3DSelected = infoArray[293] - 1;

                picBack3D.BackgroundImage = picsAll[myObjectTypes._3D.GetHashCode()][picBack3DSelected];

            }





        }





        #endregion





        #region Sync controls and set sizes





        private void frmMain_ResizeEnd(object sender, EventArgs e)

        {

            float heightScale = picAnaglyph.Height / (float)updOutputHeight.Value;



            // When you resize the main window, snow objects must  set to new position

            foreach (frmObject mySnow in mySnowCollection)

            {

                mySnow.MyBaseSize = this.Size;

                mySnow.heightScale = heightScale;

            }

        }









        private void picLeft3D_BackgroundImageChanged(object sender, EventArgs e)

        {

            //picRight3D.BackgroundImage = picLeft3D.BackgroundImage;

        }



        private void chkBirdObjects_CheckedChanged(object sender, EventArgs e)

        {

            updBirdObjects.Enabled = chkBirdObjects.Checked;

        }



        private void chkAnimalObjects_CheckedChanged(object sender, EventArgs e)

        {

            updAnimalObjects.Enabled = chkAnimalObjects.Checked;

        }



        private void chkFlowerObject_CheckedChanged(object sender, EventArgs e)

        {

            updFlowerObject.Enabled = chkFlowerObject.Checked;

        }



        private void chkTreeObject_CheckedChanged(object sender, EventArgs e)

        {

            updTreeObjects.Enabled = chkTreeObject.Checked;

        }



        #endregion





        #region select background and colors





        // show all available backgrounds and skies and select one 

        private void picSky_Click(object sender, EventArgs e)

        {

            frmSelection myfrmSky = new frmSelection();

            myfrmSky.setBackgroundImage(picsAll[myObjectTypes.Sky.GetHashCode()]);

            myfrmSky.ShowDialog();

            if (myfrmSky.selectedItem >= 0) picSkySelected = myfrmSky.selectedItem;

            picSky.BackgroundImage = picsAll[myObjectTypes.Sky.GetHashCode()][picSkySelected];



            myfrmSky.Dispose();

        }



        // show all available real 3D images and select one 

        private void picBack3D_Click(object sender, EventArgs e)

        {

            frmSelection myfrmBackgrounds = new frmSelection();

            myfrmBackgrounds.setBackgroundImage(picsAll[myObjectTypes._3D.GetHashCode()]);

            myfrmBackgrounds.ShowDialog();

            if (myfrmBackgrounds.selectedItem >= 0) picBack3DSelected = myfrmBackgrounds.selectedItem;

            picBack3D.BackgroundImage = picsAll[myObjectTypes._3D.GetHashCode()][picBack3DSelected];



            myfrmBackgrounds.Dispose();

        }



        // show all available ground textures and select one 

        private void picGround_Click(object sender, EventArgs e)

        {

            frmSelection myfrmBackgrounds = new frmSelection();

            myfrmBackgrounds.setBackgroundImage(picsAll[myObjectTypes.Ground.GetHashCode()]);

            myfrmBackgrounds.ShowDialog();

            if (myfrmBackgrounds.selectedItem >= 0) picGroundSelected = myfrmBackgrounds.selectedItem;

            picGround.BackgroundImage = picsAll[myObjectTypes.Ground.GetHashCode()][picGroundSelected];

            myfrmBackgrounds.Dispose();

        }



        // show all available water textures and select one 

        private void picWater_Click(object sender, EventArgs e)

        {

            frmSelection myfrmBackgrounds = new frmSelection();

            myfrmBackgrounds.setBackgroundImage(picsAll[myObjectTypes.Water.GetHashCode()]);

            myfrmBackgrounds.ShowDialog();

            if (myfrmBackgrounds.selectedItem >= 0) picWaterSelected = myfrmBackgrounds.selectedItem;

            picWater.BackgroundImage = picsAll[myObjectTypes.Water.GetHashCode()][picWaterSelected];

            myfrmBackgrounds.Dispose();



        }



        // show the color dialog and set the color

        private void setColor(Label thisLabel)

        {

            colorDialog1.Color = thisLabel.BackColor;

            if (colorDialog1.ShowDialog() == DialogResult.OK)

            {

                thisLabel.BackColor = colorDialog1.Color;

            }

        }



        // open external image from hard dik for sky, ground or water

        private void btnOpen_Click(object sender, EventArgs e)

        {

            try

            {

                openFileDialog1.Filter = "All Files|*.*|PNG|*.png|JPG|*.jpg|TIF|*.tif|GIF|*.gif|BMP|*.bmp";

                openFileDialog1.RestoreDirectory = true;

                openFileDialog1.FileName = "";

                if (openFileDialog1.ShowDialog() == DialogResult.OK)

                {

                    string senderName = ((Button)sender).Name;

                    switch (senderName)

                    {

                        case "btnOpenSky":

                            picSky.BackgroundImage = Image.FromFile(openFileDialog1.FileName);

                            chkRandomSky.Checked = false;

                            break;

                        case "btnOpenGround":

                            picGround.BackgroundImage = Image.FromFile(openFileDialog1.FileName);

                            chkRandomGround.Checked = false;

                            break;

                        case "btnOpenWater":

                            picWater.BackgroundImage = Image.FromFile(openFileDialog1.FileName);

                            chkRandomWater.Checked = false;

                            break;

                        case "btnOpen3D":

                            picBack3D.BackgroundImage = Image.FromFile(openFileDialog1.FileName);

                            rdoLandscape3D.Checked = true;

                            break;



                    }

                }

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.Message);

            }



        }

        #endregion





        #region Timer



        private void tmrNext_Tick(object sender, EventArgs e)

        {

            startAutoRun();



        }



        private void startAutoRun()

        {

            mnuOut2.Text = "  [Working... ]  ";

            if (chkAutoRunItemFromMenu.Checked && chkAutoRun.Checked)

            {

                switch (cmbAutoRunItems.SelectedIndex)

                {

                    // Items= Persian Golf: 8   Golestan Park :7   Special Effect:8  total=23

                    case 0:

                        runMenuItem(myMenuItemCollection[myRandom.Next(23)]);

                        break;



                    case 1:

                        runMenuItem(myMenuItemCollection[myRandom.Next(0, 8)]);

                        break;



                    case 2:

                        runMenuItem(myMenuItemCollection[myRandom.Next(8, 15)]);

                        break;



                    case 3:

                        runMenuItem(myMenuItemCollection[myRandom.Next(15, 23)]);

                        break;

                }

            }

            else goRun(false);



            if (chkAutoRefresh.Checked)

            {

                myObjectsOrientation = 2; //  invers

                for (int jj = 0; jj < updRefreshTimes.Value; jj++)

                {

                    if (jj > 0) myObjectsOrientation = 3; // random



                    mnuOut2.Text = " Refresh " + (jj + 1) + " of " + updRefreshTimes.Value + "  Orient=" + myObjectsOrientation;

                    Application.DoEvents();

                    goRun(true);

                    Application.DoEvents();

                }



            }

            mnuOut2.Text = "";

        }





        private void chkAutoRun_CheckedChanged(object sender, EventArgs e)

        {

            mnuTimerNextIcon.Enabled = chkAutoRun.Checked;

            chkAutoRunItemFromMenu.Enabled = chkAutoRun.Checked; ;

            if (!chkAutoRunItemFromMenu.Enabled) cmbAutoRunItems.Enabled = false;

            chkAutoRun.ForeColor = chkAutoRun.Checked ? Color.Red : Color.FromKnownColor(KnownColor.ControlText);

            tmrNext.Enabled = chkAutoRun.Checked;



        }



        private void updTimerNext_ValueChanged(object sender, EventArgs e)

        {

            tmrNext.Interval = (int)updTimerNext.Value * 1000;



        }



        #endregion





        #region Glasses







        private void mnuGlasses_Click(object sender, EventArgs e)

        {



            //anaglyphMatrix = new float[][][] { leftChannel, rightChannel, matrixRedChannel, matrixCyanChannel, matrixBlueChannel, matrixGreenChannel, matrixYellowChannel, matrixMagentaChannel };



            myObjectsOrientation = 0;

            ToolStripMenuItem myMenuItemSelected = (ToolStripMenuItem)sender;

            switch (myMenuItemSelected.Name)

            {

                case "mnuGlassesRedCyan":

                    anaglyphMatrix[0] = anaglyphMatrix[2];

                    anaglyphMatrix[1] = anaglyphMatrix[3];

                    break;

                case "mnuGlassesRedGreen":

                    anaglyphMatrix[0] = anaglyphMatrix[2];

                    anaglyphMatrix[1] = anaglyphMatrix[5];

                    break;

                case "mnuGlassesRedBlue":

                    anaglyphMatrix[0] = anaglyphMatrix[2];

                    anaglyphMatrix[1] = anaglyphMatrix[4];

                    break;

                case "mnuGlassesYellowBlue":

                    anaglyphMatrix[0] = anaglyphMatrix[4];

                    anaglyphMatrix[1] = anaglyphMatrix[6];

                    break;

                case "mnuGlassesMagentaGreen":

                    anaglyphMatrix[0] = anaglyphMatrix[7];

                    anaglyphMatrix[1] = anaglyphMatrix[5];

                    break;

            }

            myMenuItemSelected.Checked = true;

            myLastGlassesSelected.Checked = false;

            myLastGlassesSelected = myMenuItemSelected;



            goAnaglyph();



            showResult(mnuShowAnaglyph.SelectedIndex); // show anaglyph or left or right or red or cyan



        }







        private void mnuCalibrateGlasses_Click(object sender, EventArgs e)

        {

            frmGlasses myGlasses = new frmGlasses();

            myGlasses.myLeftBitmap = leftBitmap;

            myGlasses.myRightBitmap = rightBitmap;



            myGlasses.matrixLeft = anaglyphMatrix[0];

            myGlasses.matrixRight = anaglyphMatrix[1];

            myGlasses.ShowDialog();



            anaglyphMatrix[0] = myGlasses.matrixLeft;

            anaglyphMatrix[1] = myGlasses.matrixRight;



            goAnaglyph();



            showResult(mnuShowAnaglyph.SelectedIndex); // show anaglyph or left or right or red or cyan





            myGlasses.Dispose();





        }



        #endregion



        #region edit panel



        private void mnuEdit_Click(object sender, EventArgs e)

        {

            frmEdit myEdit = new frmEdit();



            myEdit.picsAll = picsAll;

            myEdit.myFirstPicCollection.Clear();

            foreach (picCollection myP in myAllPicCollection) myEdit.myFirstPicCollection.Add(myP);

            myEdit.myFirstImage = new Bitmap(leftBitmap);

            if (mnuShowSnow.Checked)

                foreach (frmObject mySnow in mySnowCollection) mySnow.tmrMain.Enabled = false; //disable snow in edit mode



            myEdit.ShowDialog();

            if (myEdit.OK)

            {

                myAllPicCollection.Clear();

                foreach (picCollection myP in myEdit.myNewPicCollection) myAllPicCollection.Add(myP);

                myEdit.Dispose();

                myObjectsOrientation = 0;

                goRun(true);

            }

            else myEdit.Dispose();



            if (mnuShowSnow.Checked)

                foreach (frmObject mySnow in mySnowCollection) mySnow.tmrMain.Enabled = true; //enable snow again



        }



        #endregion



        #region miscellaneous



        private void mnuAbout_Click(object sender, EventArgs e)

        {

            bool tmrStatus = tmrNext.Enabled;

            tmrNext.Enabled = false;

            frmAbout myAbout = new frmAbout();

            myAbout.ShowDialog();

            tmrNext.Enabled = tmrStatus;

        }







        private void mnuExit_Click(object sender, EventArgs e)

        {

            this.Close();

        }





        private void frmMain_LocationChanged(object sender, EventArgs e)

        {

            foreach (frmObject mySnow in mySnowCollection) mySnow.MyBasePosition = this.Location;

        }



        private void mnuStop_Click(object sender, EventArgs e)

        {

            if (isFullScreen) setFullScreen(false);



            if (pnlTop.Visible) setPanels(true);

            else setPanels(false);

            mnuFile.Select();

        }





        private void setPanels(bool myStatus)

        {

            pnlTop.Visible = !myStatus;

            mnuShowControls.Visible = myStatus;

            mnuHideControls.Visible = !myStatus;

            if (mnuShowSnow.Checked)

                foreach (frmObject mySnow in mySnowCollection) mySnow.tmrMain.Enabled = myStatus;

        }





        private void trbGeneral_Scroll(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, myTrb.Value.ToString());

        }



        private void trbObjectDepth_Scroll(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, "Overgrowth Distribution = " + myTrb.Value.ToString());



        }







        private void trbObjectSize_Scroll(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, "Size = " + myTrb.Value.ToString());



        }







        private void trbDeptStart_ValueChanged(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, "Starting Depth = " + myTrb.Value + " %");



        }



        private void trbDepthMain_ValueChanged(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, "Main Distribution = " + myTrb.Value + " %");



        }



        private void trbDepthNoise_ValueChanged(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, "Noise for Growth = " + myTrb.Value + " ");



        }



        private void showAnaglyphToolStripMenuItem_SelectedIndexChanged(object sender, EventArgs e)

        {

            int myItem = ((ToolStripComboBox)sender).SelectedIndex;



            showResult(myItem);

        }







        private void cmbGeneralEffectTop_SelectedIndexChanged(object sender, EventArgs e)

        {

            cmbGeneralEffect.SelectedIndex = cmbGeneralEffectTop.SelectedIndex;

            //if (!pnlTop.Visible) goRun(true);

        }





        private void cmbGeneralEffect_SelectedIndexChanged(object sender, EventArgs e)

        {

            cmbGeneralEffectTop.Text = cmbGeneralEffect.Text;

        }



        private void mnuAutoSave_CheckedChanged(object sender, EventArgs e)

        {

            mnuAutoSaveIcon.Enabled = mnuAutoSave.Checked;

            chkAutoSave.Checked = mnuAutoSave.Checked;



        }



        private void mnuHideControls_Click(object sender, EventArgs e)

        {

            setPanels(true);

        }



        private void mnuSite_Click(object sender, EventArgs e)

        {



            switch (((ToolStripMenuItem)sender).Name)

            {

                case "mnuSiteToorang":

                    System.Diagnostics.Process.Start("www.toorang.com");

                    break;

                case "mnuSiteNoojum":

                    System.Diagnostics.Process.Start("www.noojum.com");

                    break;

                case "mnuSiteFacebook":

                    System.Diagnostics.Process.Start("https://www.facebook.com/anaglyph2500");

                    break;

                case "mnuSiteCodeproject":

                    System.Diagnostics.Process.Start("http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=3393649");

                    break;

            }





        }



        private void chkAutoRunItemFromMenu_EnabledChanged(object sender, EventArgs e)

        {

            cmbAutoRunItems.Enabled = chkAutoRunItemFromMenu.Checked;



        }



        private void chkAutoSave_CheckedChanged(object sender, EventArgs e)

        {

            mnuAutoSave.Checked = chkAutoSave.Checked;

        }



        private void chkAutoRefresh_CheckedChanged(object sender, EventArgs e)

        {

            updRefreshTimes.Enabled = chkAutoRefresh.Checked;

        }



        private void trbPerspective_MouseEnter(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, "Perspective Level = " + myTrb.Value + "");



        }



        private void trbInitial_MouseEnter(object sender, EventArgs e)

        {

            TrackBar myTrb = (TrackBar)sender;

            toolTip1.SetToolTip(myTrb, "Initial Size = " + myTrb.Value + " %");





        }



         private void mnuFullScreen_Click(object sender, EventArgs e)

        {

            setFullScreen(true);



        }



        private void setFullScreen(bool myStatus)

        {

            this.mainMenu.Visible = !myStatus;

            this.FormBorderStyle = myStatus ? FormBorderStyle.None : FormBorderStyle.Sizable;

            this.TopMost = myStatus;

            if (myStatus) this.WindowState = FormWindowState.Maximized;



            isFullScreen = myStatus;

        }



        private void mainMenu_VisibleChanged(object sender, EventArgs e)

        {

            foreach (frmObject mySnow in mySnowCollection) mySnow.isFullScreen = !mainMenu.Visible;



        }



        private void mnuAutoSaveIcon_Click(object sender, EventArgs e)

        {

            mnuAutoSave.Checked = false;

        }



        private void mnuTimerNextIcon_Click(object sender, EventArgs e)

        {

            chkAutoRun.Checked = false;

        }



        private void mnuSnowActive_Click(object sender, EventArgs e)

        {

            mnuShowSnow.Checked = false;

        }



        private void mnuShowSnow_CheckedChanged(object sender, EventArgs e)

        {

            mnuSnowActive.Enabled = mnuShowSnow.Checked;



            if (!mnuShowSnow.Checked)

                foreach (frmObject mySnow in mySnowCollection) mySnow.Hide();



        }



        private void chkFullScreen_CheckedChanged(object sender, EventArgs e)

        {

            mnuFullScreenActive.Enabled = chkFullScreen.Checked;

            mnuFullScreen.Checked = chkFullScreen.Checked;

        }



        private void mnuFullScreenActive_Click(object sender, EventArgs e)

        {

            chkFullScreen.Checked = false;

        }



        private void mnuFullScreen_Click_1(object sender, EventArgs e)

        {

            chkFullScreen.Checked = mnuFullScreen.Checked;

        }











        private void rdoLandscape3D_CheckedChanged(object sender, EventArgs e)

        {

            picBack3D.Visible = rdoLandscape3D.Checked;

        }



        #endregion





    }





}





By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
Iran (Islamic Republic of) Iran (Islamic Republic of)

Comments and Discussions