Beispiel #1
0
void resize(ImageType& image)
{
    if(imageLoaded(image))
        {
                char option, charScale;
                int scale;

                cout << "1) Enlarge" << endl
                     << "2) Shrink" << endl << endl
                         << "Select option 1 or 2: ";
                
                cin >> option;

                // check for appropriate selection and get scale
                if(option == '1' || option == '2')
                {
                        cout << endl <<  "Enter the scaling value: ";
                        cin >> charScale;
                        cout << endl << endl;
                        scale = int(charScale) - int('0');

            // shrink or enlarge
                        switch(option)
                        {
                                case '1':
                                        image.enlargeImage(scale, image);
                                        break;
                                case '2':
                                        image.shrinkImage(scale, image);
                                        break;
                        }

                        cout << "The image was successfully scaled.";
                }

                else
                {