LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2004, 05:15 AM   #1
chandan
Member
 
Registered: Feb 2003
Location: Bangalore, India
Distribution: Fedora Core 2
Posts: 60

Rep: Reputation: 15
C function for plotting a pixel in Linux ( like putpixel of bgi)?


I have to develop a graphics package as part of my curriculum by implementing various algorithms.
I started of in dos using the bgi library of borland C.
I am using putpixel to plot a point on the screen.
Now i want to code in Linux, but not able to get an equivalent of putpixel in Linux.
Please suggest me the library and the function to do the same.
I am coding in C++.
 
Old 01-23-2004, 05:36 AM   #2
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
There's lots of different ways to do graphics in Linux. You can either use a GUI toolkit like Qt, which you can use to open a window and draw stuff in it (as well as create buttons, menus, etc.), or you can use a more low level library like SDL, which just allows you to draw in a single window or full screen.

Alex
 
Old 01-23-2004, 05:50 AM   #3
chandan
Member
 
Registered: Feb 2003
Location: Bangalore, India
Distribution: Fedora Core 2
Posts: 60

Original Poster
Rep: Reputation: 15
I don't want to develop any GUI application using Qt library.
I want a basic function to just put a pixel on the screen.
Is there a function equivalent to the putpixel function available in bgi library of borland C which takes the coordinates of the point and the color and puts it on the screen.
I basically want to use this to draw lines , circles etc using various graphics algorithms
 
Old 01-23-2004, 06:49 AM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
the SDL library should do fine but you'll have to write your own pixel plotting function(quite easy - SDL gives you a pointer to the pixel data), although there are lots of addons for SDL one of which might contain a pixel plotting function.
 
Old 01-23-2004, 09:16 AM   #5
Kurt M. Weber
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 335

Rep: Reputation: 36
You can also use SVGALib if you don't mind the fact that your code will only work on Linux.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
plotting points in scilab kevinlyfellow Linux - Software 3 03-12-2006 06:05 PM
graph plotting in c/c++ vrdhananjay Programming 1 01-20-2005 08:11 PM
Data/Map Plotting codyman General 0 11-24-2004 09:24 AM
Perl exec function in linux (and system-function) nazula Programming 1 04-19-2004 12:21 PM
redhat 7.1 plotting programs suqu Red Hat 2 10-16-2003 12:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration