Пример #1
0
    public void StartProgram()
    {
        SnapsEngine.DisplayImageFromUrl("https://st.hzcdn.com/simgs/1711fefa0603fedf_4-1809/industrial-novelty-signs.jpg"); // add background image of a diner sign
        SnapsEngine.SetTitleString("Car Counter");
        // variables that count the number of cars, vans, bikes, and trucks
        int car   = 0;
        int van   = 0;
        int bike  = 0;
        int truck = 0;


        bool button = true;

        // loop that allows user to keep clicking on different transportations until user wants sum.
        while (button == true)
        {
            // stores what user selects from the 5 buttons
            string pick = SnapsEngine.SelectFrom5Buttons("Car", "Van", "Bike", "Truck", "Sum");
            // adds one to whichever user picks
            if (pick == "Car")
            {
                car = car + 1;
            }
            if (pick == "Van")
            {
                van = van + 1;
            }
            if (pick == "Bike")
            {
                bike = bike + 1;
            }
            if (pick == "Truck")
            {
                truck = truck + 1;
            }
            if (pick == "Sum")
            {
                // if user picks sum text is cleared and then program gives user the amount of times he/she clicked on each transportation.
                SnapsEngine.ClearTextDisplay();
                SnapsEngine.AddLineToTextDisplay("There were " + car.ToString() + " cars");
                SnapsEngine.Delay(10);
                SnapsEngine.AddLineToTextDisplay("There were " + van.ToString() + " vans");
                SnapsEngine.Delay(10);
                SnapsEngine.AddLineToTextDisplay("There were " + bike.ToString() + " bikes");
                SnapsEngine.Delay(10);
                SnapsEngine.AddLineToTextDisplay("There were " + truck.ToString() + " trucks");
                SnapsEngine.Delay(10);
                // ends the ability to select transportations.
                button = false;
            }
            {
            }
        }
    }
    public void StartProgram()
    {
        string url = "ms-appx:///Images/City.jpg";

        SnapsEngine.DisplayImageFromUrl(imageURL: url);
    }
Пример #3
0
    public void StartProgram()
    {
        string url = "https://farm9.staticflickr.com/8713/16988005732_7fefe368cc_d.jpg";

        SnapsEngine.DisplayImageFromUrl(imageURL: url);
    }