Friday, 26 August 2016

Welcome to ITEC 612-613: Your Journey into Computer Graphics Begins!

Computer Graphics - COURSE SPECIFICATION

Hello future graphics pioneers! Welcome to ITEC 612-613, your gateway to the fascinating world of Computer Graphics. Ever wondered how the stunning visuals in your favorite video games are created? Or how animated movies bring characters to life? This course is your first step toward answering those questions and building the skills to create your own digital worlds.

Wednesday, 17 August 2016

Multimedia Technology - Chapter 1- Introduction to Multimedia

Multimedia Technology: Your Gateway to the Digital World

Chapter: 1 

Chapter Title: Introduction to Multimedia

Multimedia Technology Lecture 1 | Introduction to Multimedia | Elements of Multimedia | 2D 3D


Hey everyone, and welcome to the first lecture of our Multimedia Technology course! I'm Dr. Zeeshan Bhatti, and I'm thrilled to be your guide on this journey. If you've ever been mesmerized by a video game's cutscene, binge-watched a series on a streaming platform, or learned a complex skill through an interactive online tutorial, then you've already experienced the power of what we're about to study. Over the next few weeks, we're going to pull back the curtain on the digital magic. We'll move from being passive consumers to informed creators, understanding the very DNA of the digital experiences that shape our world.

Tuesday, 16 August 2016

Multimedia Technology : Chapter 2 - Graphics and Images

Multimedia Technology: Chapter: 2

Graphics and Images

Multimedia Technology Lecture 2 | Introduction to Multimedia | Graphic Designing Tools

Welcome back, future multimedia masters, to another session at Zeeshan Academy! I'm Prof. Dr. Zeeshan Bhatti, and I hope you've been observing the digital world with a more critical eye since our first lecture.

Sunday, 7 August 2016

What Goes in a Research Paper? Your Blueprint for Writing a High-Impact Article

What Goes in a Research Paper? Your Blueprint for Writing a High-Impact Article

Research Paper

Hello, future researchers and scholars! Professor Dr. Zeeshan Bhatti here from Zeeshan Academy.

In my years of mentoring students, one question pops up more than any other: "Professor, I have all this data and I've done the work, but I just don't know how to write the paper!"

Saturday, 14 May 2016

IT Project Management Chapter 6 Project Implementation

IT Project Management Chapter 6 Project Implementation


Project Implementation Model

Getting the implementation phase right the first time is crucial for any  project manager or project team. This chapter offers guidelines for successfully implementing a project and ensuring that all relevant areas  have been addressed. Remember that everything the project team  planned, developed, and changed throughout the project life cycle is now ready for implementation. Implementation, in a nutshell, refers to the efficient transfer of the project into the client's "live" production environment.

Tuesday, 10 May 2016

Computer Graphics Problem Solution: A Deep Dive into 2D Transformation

Computer Graphics Problem Solution: A Deep Dive into 2D Transformation

2D Transformation in Computer Graphics | 2D Translate Rotate object in Computer Graphics 🎮09

Hello and welcome, future graphics programmers! Professor Dr. Zeeshan Bhatti here from Zeeshan Academy. Today, we're rolling up our sleeves and tackling a problem that beautifully combines three fundamental pillars of 2D transformation: Shearing, Translation, and Rotation.

If you've ever wondered how objects move, twist, and reshape in digital space, you're in the right place. This isn't just about memorizing formulas; it's about understanding the journey a simple object takes through the magical world of linear algebra. So, grab a coffee, and let's get started!

Saturday, 23 April 2016

IT Project Management: Chapter 5 Risk Management

IT Project Management: Chapter 5 

Risk Management

Risk
Uncertain or chance events that planning can not overcome or control.
 

Risk Management

A proactive attempt to recognize and manage internal events and external threats that affect the likelihood of a project’s success.
What can go wrong (risk event).
How to minimize the risk event’s impact (consequences).
What can be done before an event occurs (anticipation).
What to do when an event occurs (contingency plans).

Risk Management’s Benefits

A proactive rather than reactive approach.
Reduces surprises and negative consequences.
Prepares the project manager to take advantage of appropriate risks.
Provides better control over the future.
Improves chances of reaching project performance objectives within budget and on time.

Managing Risk

Step 1: Risk Identification
Generate a list of possible risks through brainstorming, problem identification and risk profiling.
Macro risks first, then specific events

Step 2: Risk Assessment
Scenario analysis for event probability and impact
Risk assessment matrix
Failure Mode and Effects Analysis (FMEA)
Probability analysis
Decision trees, NPV, and PERT
Semiquantitative scenario analysis

Step 3: Risk Response Development
Mitigating Risk
Reducing the likelihood an adverse event will occur.
Reducing impact of adverse event.
Avoiding Risk
Changing the project plan to eliminate the risk or condition.
Transferring Risk
Paying a premium to pass the risk to another party.
Requiring Build-Own-Operate-Transfer (BOOT) provisions.
Retaining Risk
Making a conscious decision to accept the risk.

Download: https://www.scribd.com/doc/310174502/IT-Project-Management-Chapter-5-Risk-Managemnt

IT Project Management: Chapter 4 Resource Plan and Cost Estimation

IT Project Management: Chapter 4 Resource Plan and Cost Estimation

Assigning Resources

A schedule is not complete until all the resources necessary to complete the project have been committed or assigned.
  • Non-Labor Resources
  • Lab time
  • Facilities
  • Prototype parts/systems
  • Equipment
  • Materials

The Resource Problem

Resources and Priorities, Project network times are not a schedule until resources have been assigned.The implicit assumption is that resources will be available in the required amounts when needed. Adding new projects requires making realistic judgments of resource availability and project durations.Cost estimates are not a budget until they have been time-phased.

Resource Smoothing (or Leveling)
Involves attempting to even out varying demands on resources by using slack (delaying noncritical activities) to manage resource utilization when resources are adequate over the life of the project.

Resource-Constrained Scheduling
The duration of a project may be increased by delaying the late start of some of its activities if resources are not adequate to meet peak demands.

Types of Project Constraints

Technical or Logic Constraints
Constraints related to the networked sequence in which project activities must occur.
Physical Constraints
Activities that cannot occur in parallel or are affected by contractual or environmental conditions.
Resource Constraints
The absence, shortage, or unique interrelationship and interaction characteristics of resources that require a particular sequencing of project activities
Kinds of Resource Constraints
People, materials, equipment


Download: https://www.scribd.com/doc/310174497/IT-Project-Management-Chapter-4-Resource-Plan-and-Cost-Estimation

Tuesday, 19 April 2016

Computer Graphics Hands-On Lab: Implementing 2D Transformations in C++


Computer Graphics Hands-On Lab: Implementing 2D Transformations in C++ 

By: Dr. Zeeshan Bhatti


Solving 2D Transformation problem in Computer Graphics | 2D Translate Rotate Matrices Problem 🎮10

Artificial Intelligence: Chapter 5 - Machine Learning

Artificial Intelligence: Chapter 5 -

 Machine Learning



Definition:

A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.


Why is Machine Learning Important?

Some tasks cannot be defined well, except by examples (e.g., recognizing people). Relationships and correlations can be hidden within large amounts of data. Machine Learning/Data Mining may be able to find these relationships. Human designers often produce machines that do not work as well as desired in the environments in which they are used.


The amount of knowledge available about certain tasks might be too large for explicit encoding by humans (e.g., medical diagnostic). Environments change over time. New knowledge about tasks is constantly being discovered by humans. It may be difficult to continuously re-design systems “by hand”.


Why “Learn”?

Machine learning is programming computers to optimize a performance criterion using example data or past experience. There is no need to “learn” to calculate payroll

Learning is used when:

­- Human expertise does not exist (navigating on Mars),

­- Humans are unable to explain their expertise (speech recognition)

­- Solution changes in time (routing on a computer network)

­- Solution needs to be adapted to particular cases (user biometrics)






Machine learning is primarily concerned with the accuracy and effectiveness of the computer system.

Artificial Intelligence: Chapter 4 Introduction to Knowledge Base Systems

Artificial Intelligence: Chapter 4 

Introduction to Knowledge Base Systems


What is a knowledge-based system?

­A system which is built around a knowledge base. i.e. a collection of knowledge, taken from a human, and stored in such a way that the system can reason with it.



What is knowledge?

­Knowledge is the sort of information that people use to solve problems.



A knowledge-based agent

A knowledge-based agent includes a knowledge base and an inference system.A knowledge base is a set of representations of facts of the world. Each individual representation is called a sentence. The sentences are expressed in a knowledge representation language.


The agent operates as follows:


1. It TELLs the knowledge base what it perceives.

2. It ASKs the knowledge base what action it should perform.

3. It performs the chosen action.



Architecture of a knowledge-based agent


Knowledge Level.
­The most abstract level: describe agent by saying what it knows.
Example: A taxi agent might know that the Golden Gate Bridge connects San Francisco with the Marin County.


Logical Level.


­The level at which the knowledge is encoded into sentences.
Example: Links(GoldenGateBridge, SanFrancisco, MarinCounty).



Implementation Level.

­The physical representation of the sentences in the logical level.
­Example: ‘(links goldengatebridge sanfrancisco marincounty)


Expert systems


What is an expert system?

A particular kind of knowledge-based system. One in which the knowledge, stored in the knowledge base, has been taken from an expert in some particular field.
Therefore, an expert system can, to a certain extent, act as a substitute for the expert from whom the knowledge was taken.

Sunday, 17 April 2016

Computer Graphics, Chapter 4: The Magic of 2D Geometrical Transformations

Computer Graphics, Chapter 4: The Magic of 2D Geometrical Transformations

By: Prof. Dr. Zeeshan Bhatti

2D Transformation in Computer Graphics | 2D Translate Rotate object in Computer Graphics 🎮09

Welcome back, digital creators! Professor Dr. Zeeshan Bhatti here from Zeeshan Academy. Today, we're unlocking one of the most fundamental and visually intuitive concepts in computer graphics: 2D Geometrical Transformations.

Saturday, 16 April 2016

Artificial Intelligence Chapter 3: Problem Solving and Searching

Artificial Intelligence Chapter 3: Problem Solving and Searching 

This chapter describes one kind of goal-based agent called a problem-solving agent. Problem-solving agents use atomic representations, —that is, states of the world are considered as wholes, with no internal structure visible to the problem solving algorithms. Goal-based agents that use more advanced factored or structured representations are usually called planning agents.
Our discussion of problem solving begins with precise definitions of problems and their solutions and give several examples to illustrate these definitions. We then describe several
general-purpose search algorithms that can be used to solve these problems. We will see
several uninformed search algorithms—algorithms that are given no information about the
problem other than its definition. Although some of these algorithms can solve any solvable
problem, none of them can do so efficiently. Informed search algorithms, on the other hand,
can do quite well given some guidance on where to look for solutions.

Intelligent agents are supposed to maximize their performance measure. As we mentioned
in Chapter 2, achieving this is sometimes simplified if the agent can adopt a goal and aim at
satisfying it. Let us first look at why and how an agent might do this.

Imagine an agent in the city of Arad, Romania, enjoying a touring holiday. The agent’s
performance measure contains many factors: it wants to improve its suntan, improve its Romanian, take in the sights, enjoy the nightlife (such as it is), avoid hangovers, and so on. The decision problem is a complex one involving many tradeoffs and careful reading of guidebooks. Now, suppose the agent has a nonrefundable ticket to fly out of Bucharest the following day. In that case, it makes sense for the agent to adopt the goalof getting to Bucharest. Courses of action that don’t reach Bucharest on time can be rejected without further consideration and the agent’s decision problem is greatly simplified. Goals help organize behavior by limiting the objectives that the agent is trying to achieve and hence the actions it needs to consider. Goal formulation, based on the current situation and the agent’s performance measure, is the first step in problem solving.

state space graph
 

Outline: Problem solving and search

Introduction to Problem Solving
Complexity
Uninformed search
Problem formulation
Search strategies: depth-first, breadth-first

Informed search
Search strategies: best-first, A*
Heuristic functions

Sunday, 10 April 2016

IT PROJECT MANAGEMENT: Chapter 3_ Project Estimating Techniques and Tools

IT PROJECT MANAGEMENT

Project Estimating Techniques and Tools

Chapter 3

ITPM Process

PROJECT PLAN CONTENTS

In this chapter we will be discussing Statement of work (SOW), Work breakdown structures (WBS), Responsibility assignment matrices, Project schedule, Resource plans/histograms, Budget, Risk management plan, Communications plan, Quality plan, Verification and validation plan.

PROJECT NOTEBOOK

  • Project Pre-plan
    • Background information
    • Customer data
    • Third-party data (vendors, suppliers, etc.)
  • Project Plan
    • Statement of Work (SOW)
    • Work Breakdown Structure (WBS)
    • Organization/responsibility charts
    • Schedule data
    • Budget/capital plan
    • Risk management
  • Project Implementation
    • Meetings (agenda/minutes)
    • Team/management/customer/third party progress reports
    • Customer change requests/decision matrix issue resolution forms/reports

  • Project Close-out
    • Final evaluation of measurable success indicators
    • Close-out meeting (agenda/minutes)
    • Final project report
    • Reference letters
    • Lessons learned
  • Project Administration
    • Contractual documents
    • Invoices
    • Expenses
    • Correspondence
    • Contact log 

      Further in this chapter we will be discussing each of the components regarding a project planning and management. All these are necessary features to design a successful project. 
ITPM Road Map


IT Project Management - Chapter 3 Project Estimating Techniques and Tools

Computer Graphics, Chapter 3: Solid Area (Polygon) Filling

Computer Graphics Demystified: Solid Area Polygon Filling and the Inside-Outside Test (Chapter-3)

- By: Prod. Dr. Zeeshan Bhatti

Bresenham Circle Drawing Algorithm in Computer Graphics | Circle Drawing using Algorithm 🎮07 Part-1

Hello and welcome back, future graphics experts! Professor Dr. Zeeshan Bhatti here from 
Zeeshan Academy. Today, we're tackling a fundamental question that sits at the heart of every digital image: How does a computer know which pixels to color inside a shape?

Monday, 28 March 2016

Computer Graphics Hands-On Lab: Mastering Circle Drawing Algorithms in C++

Computer Graphics Hands-On Lab-2: Mastering Circle Drawing Algorithms in C++
By: Dr. Zeeshan Bhatti 

Focus Keyword: Circle Drawing Algorithms

Master the art of drawing perfect circles in computer graphics! This lab project by Dr. Zeeshan Bhatti guides you through Polynomial and Bresenham's Circle Algorithms in C++, with 7 practical tasks to build your skills.

Bresenham Circle Drawing Algorithm in Computer Graphics | Circle Drawing using Algorithm 🎮07 Part-1

Computer Graphics Hands-On Lab: Mastering Line Drawing Algorithms in C++ - DDA vs. Bresenham

Computer Graphics Hands-On Lab-1 : Mastering Line Drawing Algorithms in C++ - DDA vs. Bresenham

Focus Keyword: Line Drawing Algorithms

Instructor: Dr. Zeeshan Bhatti

Polynomial Method Line Drawing in Computer Graphics | How to Draw Line using DDA algorithm in CG 🎮04

Lab Objectives

Welcome to your first computer graphics lab! This foundational session introduces you to the core problem of raster graphics: how to draw a straight line on a pixel-based display. By the end of this lab, you will:

Sunday, 27 March 2016

Computer Graphics using Java: Java Graphics Programming Lab: Mastering 2D Shapes and Geometric Primitives

Computer Graphics using Java: Java Graphics Programming: Mastering 2D Shapes and Geometric Primitives using JAva 

By: Dr. Zeeshan Bhatti

Basics of Computer Graphics | What is Computer Graphics | Computer Graphics full Course Urdu  🎮02

The Java 2D™ API provides several classes that define common geometric objects such as points, lines, curves, and rectangles. These geometry classes are part of the java.awt.geom package.

Saturday, 19 March 2016

Maya Tutorial: SET DRIVEN KEY IN MAYA

Learn how to use Maya’s set driven key feature and to set up a facial rig in this new video tutorial

Following are few quick scipts to create MEL GUI components:


create a window
 window;

  // define the layout of controls added 
  // to the window.
  columnLayout;

   // create some text
   text -label "hello world";

 // show the window we last created
 showWindow;

Slider:
attrFieldSliderGrp -min -10 -max 10 -cw 1 20 -cw 2 1 -cw 3 70
                              -at RightLeg_CTRL.AnkelRotate
                              -l aud AFD1;

Button:
button -w 70 -h 20 -label "Select All" -ann "Select all Controls" -c selAll

Symbol Button

// create window
window;
columnLayout;
   
  // create three symbol buttons with related mel command
  symbolButton -image "circle.xpm" -command "circle";
  symbolButton -image "sphere.xpm" -command "sphere";
  symbolButton -image "cube.xpm" -command "polyCube";
showWindow;


Checkbox:
checkBox -label "IK_FK" -w 30 -h 19 -ann "Switch IK FK control"
                 -onc "l_showIKFK(\"1\")"
                 -ofc "l_showIKFK(\"0\")"
                 ik_fk_switch;

example:
// create a checkbox
$c = `checkBox -label "thingy" -onCommand "on_func" -offCommand "off_func"`;
// to get the current value of the checkBox, use the -query flag
$value = `checkBox -query -value $c`;
print("check_box value = "+ $value +"\n");


Button with IMAGE:
iconTextButton -style "iconOnly" -mw 0 -mh 0 -ann "Select Hand CTRL"
                          -image1 "bbutton.bmp" -w 20 -h 20
                          -command "SelectHandCTRL(\"Left\")" 
                           selHand_Ctrl;

               

Friday, 18 March 2016

Computer Graphcis using C/C++ - Lab Handout


Computer Graphics using C/C++ -  Lab Handout 

Computer Graphics (ITEC-613 & SENG-613)

BS(IT) P-IV & BS(SW) P-IV First Semester 2016

Lab Handout: 1

By: Dr. Zeeshan Bhatti

Turbo C/C++ has a good collection of graphics libraries. If you know the basics of C/C++, you can easily learn graphics programming. To start programming, let us write a small program that displays a circle on the screen.

Simple Graphics Program 1:
/* simple.c
*/
#include<graphics.h>
#include<conio.h>

void main()
{
int gd=DETECT, gm;
clrscr();
initgraph(&gd, &gm, "c:\\tc\\bgi " );
circle(200,100,150);

getch();
closegraph();
}

To run this program, you need graphics.h header file, graphics.lib library file and Graphics driver (BGI file) in the program folder. These files are part of Turbo C package. In all our programs we used 640x480 VGA monitor. So all the programs are according to that specification. For VGA monitor, graphics driver used is EGAVGA.BGI.

Here, initgraph() function initializes the graphics mode and clears the screen.

initgraph function:


Initializes the graphics system.

Declaration:
initgraph(int far *graphdriver, int far *graphmode, char far *pathtodriver);

Remarks: To start the graphics system, you must first call initgraph.

initgraph initializes the graphics system by loading a graphics driver from disk (or validating a registered driver) then putting the system into graphics mode.

initgraph also resets all graphics settings (color, palette, current position, viewport, etc.) to their defaults, then resets graphresult to 0.
Arguments:

*graphdriver: Integer that specifies the graphics driver to be used. You can give graphdriver a value using a constant of the graphics drivers enumeration type.

*graphmode : Integer that specifies the initial graphics mode (unless *graphdriver = DETECT). If *graphdriver = DETECT, initgraph sets *graphmode to the highest resolution available for the detected driver. You can give *graphmode a value using a constant of the graphics_modes enumeration type.

pathtodriver : Specifies the directory path where initgraph looks for graphics drivers (*.BGI) first. If they're not there, initgraph looks in the current directory. If pathtodriver is null, the driver files must be in the current directory. This is also the path settextstyle searches for the stroked character font files (*.CHR).

closegraph() function:

closegraph() function switches back the screen from graphcs mode to text mode. It clears the screen also. A graphics program should have a closegraph function at the end of graphics. Otherwise DOS screen will not go to text mode after running the program. Here, closegraph() is called after getch() since screen should not clear until user hits a key.

If you have the BGI file in the same folder of your program, you can just leave it as "" only. you need not mention *graphmode if you give *graphdriver as DETECT.

To get details of different graphics modes and graphics drivers, view appendix.

In graphics mode, all the screen co-ordinates are mentioned in terms of pixels. Number of pixels in the screen decides resolution of the screen. In the example 1.0, circle is drawn with x-coordinate of the center 200, y-coordinate 100 and radius 150 pixels. All the coordinates are mentioned with respect to top-left corner of the screen.

Basic Shapes and Colors:


Now let us write a program to draw some basic shapes.
Simple Graphics Program 2:

/*
shapes.c
*/

#include<graphics.h>
#include<conio.h>

void main()
{
int gd=DETECT, gm;
int poly[12]={350,450, 350,410, 430,400, 350,350, 300,430, 350,450 };
initgraph(&gd, &gm, "");
circle(100,100,50);
outtextxy(75,170, "Circle");
rectangle(200,50,350,150);
outtextxy(240, 170, "Rectangle");
ellipse(500, 100,0,360, 100,50);
outtextxy(480, 170, "Ellipse");
line(100,250,540,250);
outtextxy(300,260,"Line");

sector(150, 400, 30, 300, 100,50);
outtextxy(120, 460, "Sector");
drawpoly(6, poly);
outtextxy(340, 460, "Polygon");
getch();
closegraph();
}


Figure 1: Here is the screenshot of output.


Here, circle() function takes x, y coordinates of the circle with respect to left top of the screen and radius of the circle in terms of pixels as arguments. Not that, in graphics, almost all the screen parameters are measured in terms of pixels.

Function outtextxy() displays a string in graphical mode. You can use different fonts, text sizes, alignments, colors and directions of the text that we will study later. Parameters passed are x and y coordinates of the position on the screen where text is to be displayed. There is another function outtext() that displayes a text in the current position. Current position is the place where last drawing is ended. These functions are declared as follows:

void far outtextxy(int x, int y, char *text);
void far outtext(char *text);

Another basic shape that we come across is a rectangle. To draw a border, use rectangle with the coordinates of outline, to draw a square use rectangle with same height and width. drawpoly() and fillpoly() are two functions useful to draw any polygons. To use these functions, store coordinates of the shape in an array and pass the address of array as an argument to the function. By looking at the output of the previous program, you can understand what drawpoly is. fillpoly is similar except that it fills in the shape with current fill color.

Declaration:

void far rectangle(int x1, int y1, int x2, int y2);

void far drawpoly(int numpoints, int far *polypoints);

void far fillpoly(int numpoints, int far *polypoints);

Remarks:

rectangle draws a rectangle in the current line style, thickness, and drawing color.

drawpoly draws a polygon using the current line style and color.

fillpoly draws the outline of a polygon using the current line style and color, then fills the polygon using the current fill pattern and fill color.

Arguments:

(x1,y1) is the upper left corner of the rectangle, and (x2,y2) is its lower right corner.

numpoints: Specifies number of points

*polypoints: Points to a sequence of (numpoints x 2) integers. Each pair of integers gives the x and y coordinates of a point on the polygon.

To draw a closed polygon with N points, numpoints should be N+1 and the array polypoints[] should contain 2(N+1) integers with first 2 integers equal to last 2 integers.

Colors :

Here is some idea about colors. There are 16 colors declared in graphics.h as listed bellow.

CPP ObjectsCPP Basic ShapesBLACK: 0
BLUE: 1
GREEN: 2
CYAN: 3
RED: 4
MAGENTA: 5
BROWN: 6
LIGHTGRAY: 7
DARKGRAY: 8
LIGHTBLUE: 9
LIGHTGREEN: 10
LIGHTCYAN: 11
LIGHTRED: 12
LIGHTMAGENTA: 13
YELLOW: 14
WHITE: 15

To use these colors, use functions setcolor(), setbkcolor() and setfillstyle(). setcolor() function sets the current drawing color. If we use setcolor(RED); and draw any shape, line or text after that, the drawing will be in red color. You can either use color as defined above or number like setcolor(4);. setbkcolor() sets background color for drawing. Setfillstyle sets fill pattern and fill colors. After calling setfillstyle, if we use functions like floodfill, fillpoly, bar etc, shpes will be filled with fill color and pattern set using setfillstyle. These function declarations are as follows

Declaration:
void far setfillstyle(int pattern, int color);
void far setcolor(int color);
void far setbkcolor(int color);

Remarks:
setfillstyle sets the current fill pattern and fill color.
setcolor sets the current drawing color to color, which can range from 0 to getmaxcolor.
setbkcolor sets the background to the color specified by color.

The parameter pattern in setfillstyle is as follows:
Names
Value
Means Fill With...
EMPTY_FILL
0
Background color
SOLID_FILL
1
Solid fill
LINE_FILL
2
---
LTSLASH_FILL
3
///
SLASH_FILL
4
///, thick lines
BKSLASH_FILL
5
\\\, thick lines
LTBKSLASH_FILL
6
\\\
HATCH_FILL
7
Light hatch
XHATCH_FILL
8
Heavy crosshatch
INTERLEAVE_FILL
9
Interleaving lines
WIDE_DOT_FILL
10
Widely spaced dots
CLOSE_DOT_FILL
11
Closely spaced dots
USER_FILL
12
User-defin


Here is an example program with colors, pixels, bar,
Simple Graphics Program 3:

/*
random.c
some graphics effects using random numbers.
*/

#include "graphics.h"
#include "conio.h"
#include "stdlib.h"

void main()
{
int gd,gm;
gd=DETECT;

initgraph(&gd, &gm, "");
setcolor(3);
setfillstyle(SOLID_FILL,RED);
bar(50, 50, 590, 430);
setfillstyle(1, 14);
bar(100, 100, 540, 380);

while(!kbhit())
{
putpixel(random(439)+101, random(279)+101,random(16));
setcolor(random(16));
circle(320,240,random(100));
}
getch();
closegraph();
}

Summary List of Graphics Functions

  1. rectangle(x1, y1, x2 , y2);
  2. line(x1, y1, x2 , y2);
  3. bar (x1, y1, x2 , y2);
  4. 3dbar(x1, y1, x2 , y2 , depth, topFlag);
  5. circle(x, y, radius);
  6. putpixel(x, y);
  7. ellipse(x, y, start, end, xRadius, yRadius);
  8. arc(x1, y1, x2, y2, radius);
  9. outtext(“Text”);
  10. outtextxy(x, y, “Text”);
  11. settextstyle(fontStyle, Direction, CharSize); // Direction = 0 or 1
ie: settextstyle(1,0,7);
  1. setfillstyle(pattern, color);
  2. floodfill(x, y, boarderColor);
  3. setbkcolor(colorNo); // Cgange the background color of the dos window
  4. setColor(colorNo); // set the color of the text or objects
  5. setlinestyle(type, pattern, thickness); // type = 1 – 5, thickness= 1-3
  6. kbhit(); // keyboard hit: any key pressed from the keyboard, like getche();

Featured post

👉 🔥 Master Full Stack Web Development | Week-1 Lecture-1 - HTML & Frontend vs Backend, Dr. Zeeshan Bhatti

  Hey there, future coders! Welcome to the most exciting journey of your life. I'm  Dr. Zeeshan Bhatti  from  Zeeshan Academy , and you...