473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to use graphics???

hello everyone,
we have a course on computer graphics and they are teaching various
algorithms to draw lines and circles and all of them
require the classical putpixel() function in c++. As i have learned
from web sources that this function is no longer in existence .is that
true?? and if so what can i use that can provide the same
functionalities, i mean is there a new form of that function or what
should i do??

i use gnu g++ on command line.

thank you very much.
mohan gupta
Aug 11 '08 #1
5 2184
Sam
mohi writes:
hello everyone,
we have a course on computer graphics and they are teaching various
algorithms to draw lines and circles and all of them
require the classical putpixel() function in c++. As i have learned
from web sources that this function is no longer in existence .is that
true??
No such function ever existed in C++. C++, the language, does not provide
any graphics API.
and if so what can i use that can provide the same
functionalities, i mean is there a new form of that function or what
should i do??

i use gnu g++ on command line.
Traditionally, graphics APIs are provided by some separate graphic library.
Find some graphics library, and learn its API functions.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkigHM8ACgkQx9p3GYHlUOKiQgCeOHRLc9COIG/P7b3w0y45Xxvq
xb8AnApJRT0dJp8DmBV1QKzfS/P2NAhc
=kEjo
-----END PGP SIGNATURE-----

Aug 11 '08 #2
On Aug 11, 6:48*am, mohi <mohangupt...@gmail.comwrote:
hello everyone,
we have a course on computer graphics and they are teaching various
algorithms to draw lines and circles and all of them
require the classical putpixel() function in c++. As i have *learned

You should really just ask your professor what platform he expects you
to use.

Joe Cook

Aug 11 '08 #3
tni
Alf P. Steinbach wrote:
Note: the above doesn't compile cleanly with Visual C++. That's because
the PNG i/o is really really horrible code (adding a notch of
horribility (whatever) to the degree present in the main library).

[...]

Especially the diagnostic about 'setjmp' makes alarm bells go off in my
brain.
It's not like they have much choice. Like IJG libjpeg, libpng uses an
error handler function (that can be provided by the client) that's not
supposed to return. They could throw an exception, but that's even worse
unless libpng was compiled as C++.

However, the way they are doing it is completely broken and will at
least result in memory leaks.
Aug 12 '08 #4
tni wrote:
It's not like they have much choice. Like IJG libjpeg, libpng uses an
error handler function (that can be provided by the client) that's not
supposed to return. They could throw an exception, but that's even worse
unless libpng was compiled as C++.
The libpng library is a horrible, horrible monstrosity, even for a C
library. I wouldn't recommend using it even if you were writing a C
program, except that for some reason there doesn't seem to be any good
popular alternative out there.

It *is* possible to implement easy-to-use clean libraries even in C.
Just look at zlib for instance. Why they decided to make libpng so
horrible is beyond my grasp.
Aug 12 '08 #5
mohi wrote:
hello everyone,
we have a course on computer graphics and they are teaching various
algorithms to draw lines and circles and all of them
require the classical putpixel() function in c++. As i have learned
from web sources that this function is no longer in existence .is that
true?? and if so what can i use that can provide the same
functionalities, i mean is there a new form of that function or what
should i do??

i use gnu g++ on command line.
You don't specify which OS you are on, but if it has the GTK+ devel
libraries installed, you can use the simple DrawWindow library available
at this page for simple point, line and circle drawing on a graphical
window. It's very easy to use:

http://www.cs.tut.fi/~tgraf/harjoitustyot/harkka1/

(The library also has simple support for mouse input, so your app can
be interactive.)
Aug 13 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JBiagio | last post by:
Hello All, I am attempting to learn a bit about the GDI+ transforms and charting data and I feel like I'm getting a handle on how the transforms work. My chart object has a large "canvas" bitmap...
12
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
2
by: John Bailo | last post by:
I am walking through some of the very first sample code from the book "Beginning .NET Game Programming" from Apress. I identify his sample code with //SC This code puzzles me: Graphics graph...
14
by: Pmb | last post by:
At the moment I'm using Borland's C++ (http://www.borland.com/products/downloads/download_cbuilder.html#) I want to be able to take an array of points and plot them on the screen. Is there a way...
5
by: Charles A. Lackman | last post by:
Hello, I have created a complete PrintDocument and need to create an image from it. How is this done? e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality...
6
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument...
12
by: Xah Lee | last post by:
Of Interest: Introduction to 3D Graphics Programing http://xahlee.org/3d/index.html Currently, this introduction introduces you to the graphics format of Mathematica, and two Java Applet...
6
by: active | last post by:
I have an image and a graphics object created (FromImage) from that image. I need to create a new image and create a new graphics object from the new image. I want the new graphics object have...
9
by: DaveL | last post by:
hello I have a Bit map 1367 wide 32 high this bitmap contains like 40 separate Images 32x32 I tell it the id*32 to get the approiate Image from the source Bitmap When i CreateGraphics()...
8
by: Abhiraj Chauhan | last post by:
I need someone to make an example of how to create a graphics window in VB.net 2008. I understand the basics of how to draw a rectangle and lines etc. What I need is an example of how to make a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.