DrawEllipse. PHP Tutorials. 2D Graphics. GD. Web Application. This web application (site) consists of an HTML page with a file named "index.html" and a PHP script with a file named "DrawEllipse.php." The web page with the file named "Index.html" is the start page of the web application (site). It is a web form for submitting data to the PHP script with the file named "DrawEllipse.php" using the "POST" method. Consists of the following elements:
- A label with the name "label1" and the value "Width:".
- A numeric input field named "EllipseWidth".
- A label with the name "label2" and the value "Height:".
- A numeric input field named "EllipseHeight".
- A "submit data" button with the name "Submit" and the value "Submit".
- The "reset data" button with the name "Reset" and the value "Reset". A PHP script with a file named "DrawEllipse.php" does the following:
- Reads web form data. Data is read from numeric fields named "EllipseWidth" and "EllipseHeight."
- Creates variables to store the dimensions of the ellipse displayed on the screen.
- Creates an image with dimensions given by the values of the corresponding variables.
- Clears it with black color.
- Creates variables for the red outline and yellow color of the ellipse.
- Sets the ellipse outline thickness to 30 pixels.
- Draws an ellipse with the previously specified parameters on a black background.
- Sets the data format for output to the web page as a png image.
- Outputs data to a browser web page.
- Frees resources and terminates.
DrawEllipse. Занятия по PHP. 2D Графика. Библиотека GD. Веб Приложение. Данное веб приложение (сайт) состоит из HTML страницы с файлом по имени "index.html" и скрипта на языке программирования PHP с файлом по имени "DrawEllipse.php". Веб страница с файлом по имени "Index.html" является стартовой страницей веб приложения (сайта). Представляет собой веб форму для передачи данных в скрипт на языке программирования PHP с файлом по имени "DrawEllipse.php" методом "POST". Состоит из следующих элементов:
- Надпись с именем "label1" и значением "Width:".
- Числовое поле ввода данных с именем "EllipseWidth".
- Надпись с именем "label2" и значением "Height:".
- Числовое поле ввода данных с именем "EllipseHeight".
- Кнопка "отправка данных" с именем "Submit" и значением "Submit".
- Кнопка "сброс данных" с именем "Reset" и значением "Reset". Скрипт на языке программирования PHP с файлом по имени "DrawEllipse.php" делает следущее:
- Читает данные веб формы. Данные считываются из числовых полей с именами "EllipseWidth" и "EllipseHeight".
- Создаёт переменные для сохранения размеров выводимого на экран эллипса.
- Создаёт картинку с размерами со значениями соответствующих переменных.
- Очищает её чёрным светом.
- Создаёт переменные для красного контура и жёлтого цвета эллипса.
- Устанавливает толщину контура эллипса в 30 пикселей.
- Рисует эллипс с заданными ранее параметрами на чёрнрм фоне.
- Устанвливает формат данных для вывода на веб страницу как картинка png.
- Выводит данные на веб страницу браузера.
- Освобождает ресурсы и завершает работу.