Posts

Image
Assignment 3: Write C++/Java program for line drawing using DDA or Bresenhams algorithm with patterns such as solid, dotted, dash dot and thick. Program: The Program is created using QTCreator. And consist of following files: (click on these link to view) mainwindow.cpp #include "mainwindow.h" #include "ui_mainwindow.h" #include<math.h> QImage image(511, 351, QImage::Format_RGB888); MainWindow::MainWindow(QWidget *parent) :     QMainWindow(parent),     ui(new Ui::MainWindow) {     ui->setupUi(this); } MainWindow::~MainWindow() {     delete ui; } int MainWindow:: sign(float a) {     if(a<0)         return -1;     else if(a==0)         return 0;     else         return 1; } QImage getI() {     return image; } void MainWindow::on_pushButton_cl...
Image
Assignment 2: Write C++/Java program to draw inscribed and Circumcircled circles in triangle as shown below: Program: The Program is created using QTCreator. And consist of following files: (click on these link to view) mainwindow.cpp  #include "mainwindow.h" #include "ui_mainwindow.h" #include<math.h> QImage image(411,391,QImage::Format_RGB888); MainWindow::MainWindow(QWidget *parent) :     QMainWindow(parent),     ui(new Ui::MainWindow) {     ui->setupUi(this); } MainWindow::~MainWindow() {     delete ui; } void MainWindow::draw_DDA(float r, float x, float y) {     float x1,y1,x2,y2,start_x,start_y,e;     int i,val;     x1=r;     y1=0;     start_x=x1;     start_y=y1;     i=0;     do{         val=pow(2,i);     ...
Image
Computer Graphics Programs Using QTCreator [Reference: qt_Tutorial.doc] Creating First Qt Form: 1.       Open the Qt Creator 2.       Click on the User Interface icon. 3.       Click on File->New File or Project->Qt Widgets   Application/Qt GUI Application 4.       Click Choose. 5.       Give a name to your project. Select a workspace. 6.       Press Next->Next->Finish. 7.       Your first Qt project is created. 8.       Create a GUI as per the need.   รจ If you encounter No kits found error : 1.       Click on the options link. 2.       Select Build and Run. 3.       Click on Desktop. 4.       Change version from none to ...
Image
Assignment 1: Write C++/Java program to draw the following pattern using Line drawing algorithms. Program: The Program is created using QTCreator. And consist of following files: (click on these link to view) mainwindow.cpp #include "mainwindow.h" #include "ui_mainwindow.h" //create global image object QImage image(551,271,QImage::Format_RGB888); MainWindow::MainWindow(QWidget *parent) :     QMainWindow(parent),     ui(new Ui::MainWindow) {     ui->setupUi(this); } MainWindow::~MainWindow() {     delete ui; } int MainWindow::sign(int x) {     if(x<0)         return -1;     else if(x==0)         return 0;     else         return 1; } void MainWindow::dda(float x1,float y1,float x2,float y2) {     float x,y,dx,dy,l,i;     QRgb va...