Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

Concept of Pixel in C Graphics

By Sripriya R | on July 11, 2006 |
C Language

Concept of Pixel in C Graphics

Pixel is otherwise called as picture elements. These are nothing but small dots. Using these tiny dots or in other words pixels images especially graphics images are built on screen.

If all pictures are built by concept of pixel then wondering how each picture differ that is how some picture appear more brighter while some other have a shady effect. All this is by the concept or technically terminology called as resolution.

So let’s have an insight on this important terminology.

Resolution is the number of rows that appear from top to bottom of a screen and in turn the number of pixels or pixel elements that appear from left to right on each scan line. Based on this resolution only the effect of picture appears on screen. In other words greater the resolution greater will be the clarity of picture. This is because greater the number of dots greater will be sharpness of picture. That is resolution value is directly proportional to clarity of picture.

There are generally two modes available namely text and graphics. In a graphics mode we have generally the following adapters namely CGA called as Color Graphics Adapter, EGA and VGA. Each adapter differs in the way of generating colors and also in the number of colors produced by each adapter.

Pixel being a picture element when we consider the graphics mode each pixel has a color associated with it. But the way these colors are used depends on adapters because each adapter differs in the way they handle colors and also in the number of colors supported.

Having known about adapters now let us start knowing on how to start switching to graphics mode from text mode in other words how to start using pixel and resolution concepts.

This is done by a function called initgraph ( ).This initgraph ( ) takes in it 2 main arguments as input namely gd and gm.

In this gd has the number of mode which has the best resolution. This is very vital for graphics since the best resolution only gives a sharper picture as we have seen before. This value is obtained by using the function called as getgraphmode ( ) in C graphics.

The other argument gm gives insight about the monitor used, the corresponding resolution of that, the colors that are available since this varies based on adapters supported. This value is obtained by using the function named as getmodename ( ) in C graphics.

Graphics function in C and Pixel Concept

There are numerous graphics functions available in c. But let us see some to have an understanding of how and where a pixel is placed in each when each of the graphics function gets invoked.

Function:
putpixel(x, y, color)

Purpose:
The functionality of this function is it put a pixel or in other words a dot at position x, y given in inputted argument. Here one must understand that the whole screen is imagined as a graph. In other words the pixel at the top left hand corner of the screen represents the value (0, 0).

Here the color is the integer value associated with colors and when specified the picture element or the dot is placed with the appropriate color associated with that integer value.

Function:
Line(x1, y1, x2, y2)

Purpose:
The functionality of this function is to draw a line from (x1,y1) to (x2,y2).Here also the coordinates are passed taking the pixel (0,0) at the top left hand corner of the screen as the origin. And also one must note that the line formed is by using number of pixels placed near each other.

Function:
getpixel(x, y)

Purpose:
This function when invoked gets the color of the pixel specified. The color got will be the integer value associated with that color and hence the function gets an integer value as return value.

So the smallest element on the graphics display screen is a pixel or a dot and the pixels are used in this way to place images in graphics screen in C language.

« « How To Properly Approach a Problem
TSR in C – An Introduction » »

Author Description

Avatar

Ads

Free Training

RSSSubscribe 417 Followers
Ads
  • Popular
  • Recent
  • C Language – The Preprocessor

    May 31, 2006 - 0 Comment
  • C Programming – Decision Making – Looping

    April 4, 2006 - 0 Comment
  • Call by Value and Call by Reference

    July 6, 2006 - 0 Comment
  • C Programming – Arrays

    April 13, 2006 - 0 Comment
  • TSR in C – An Introduction

    July 11, 2006 - 0 Comment
  • C Programming – Handling of Character String

    April 17, 2006 - 0 Comment
  • C Programming – Data Types : Part 2

    August 21, 2011 - 0 Comment
  • C Programming – An Overview

    March 2, 2006 - 0 Comment
  • C Programming – Functions (Part-II)

    May 22, 2006 - 0 Comment
  • C Doubly Linked Lists

    June 26, 2011 - 0 Comment
  • C Programming – Data Types : Part 2

    August 21, 2011 - 0 Comment
  • C Circular Linked Lists

    June 26, 2011 - 0 Comment
  • C Doubly Linked Lists

    June 26, 2011 - 0 Comment
  • TSR in C – An Introduction

    July 11, 2006 - 0 Comment
  • Call by Value and Call by Reference

    July 6, 2006 - 0 Comment
  • C Language – The Preprocessor

    May 31, 2006 - 0 Comment
  • C Programming – File management in C

    May 31, 2006 - 0 Comment
  • C Programming – Linked Lists

    May 29, 2006 - 0 Comment
  • C Programming – Dynamic Memory allocation

    May 29, 2006 - 0 Comment
  • C Programming – Pointers

    May 25, 2006 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • C Programming – Data Types : Part 2
  • C Circular Linked Lists
  • C Doubly Linked Lists
  • TSR in C – An Introduction
  • Call by Value and Call by Reference

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2021. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy
Necessary Always Enabled