473,805 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c without usin any graphics function

if u give cordinates to programme at run time and want a line to be
drawn.. how to do this in c without usin any graphics function?
like x1,y1 and x2,y2
and lines should be drawn from the 1st co-ordinate to 2nd one

any pointer would be appreciated

Thanks

Sep 6 '07
43 1928
Chris Hills wrote, On 07/09/07 11:41:
In article <ln************ @nuthaus.mib.or g>, Keith Thompson
<ks***@mib.orgw rites
>ge*******@gmail .com writes:
>>On Sep 5, 11:50 pm, shaanxxx <shaan...@yahoo .comwrote:
if u give cordinates to programme at run time and want a line to be
drawn.. how to do this in c without usin any graphics function?
like x1,y1 and x2,y2
and lines should be drawn from the 1st co-ordinate to 2nd one

any pointer would be appreciated

Thanks

#include<stdi o.h>
#include<coni o.h>

This header is non-standard.

A more useful comment is that this only works on and MS platform?
It would certainly be more inaccurate.
[markg@cpa-re-test ~]1001$ locate conio.h
/usr/lib/bcc/include/conio.h
[markg@cpa-re-test ~]1002$ uname -a
Linux cpa-re-test 2.4.21-27.0.2.EL.sgi9s mp #1 SMP Wed Feb 23 07:14:32
PST 2005 i686 i686 i386 GNU/Linux
[markg@cpa-re-test ~]1004$ rpm -qf /usr/lib/bcc/include/conio.h
dev86-0.16.3-8
[markg@cpa-re-test ~]1005$
>>void main()
Wrong. main returns int.

Not always but if we are assuming "conio.h" then it should
Wrong again.
[markg@cpa-re-test ~]1007$ cat t.c
void main()
{
}
[markg@cpa-re-test ~]1008$ gcc t.c
t.c: In function `main':
t.c:2: warning: return type of `main' is not `int'
[markg@cpa-re-test ~]1009$
>>{
int b=176;
textcolor(8); // Use this inbuilt function in C to change the color
of text
There is no 'textcolor' function in standard C.

He is apparently using an MS platform. If you can't tell that perhaps
you should not be giving any advice.
Ah, but the OP may well not be, so Keith is correct to report the problems.
>> for(b=176;b<224 ;b++)
{
printf("\n\t %c",b);
}

/* Above for loop will print the characters available in C for
graphics programming
you can use these characters to design GUI (graphical user interface)
for your application.
Even The turboc Editor can be designed with the above characters. Just
you have to use the for
and while loop properly */

This is entirely system-specific.

So what?
So there is a good chance of it NOT working on the OPs platform and the
OP needs to know the advice given by this respondent is not generally
applicable.
>>For More C Source Codes and tutorials refer
http://zsoftwares.googlepages.com/CPrograms.html

How many times do you intend to advertise this site? Once was more
than enough.

Et too... No need to keep up the "this is not standard C" mantra Either
be helpful or don't get involved.
Your reply was not helpful, so perhaps you should follow your own advice.
--
Flash Gordon
Sep 8 '07 #41
Richard Heathfield wrote:
....
I have consulted my trusty Chambers dictionary, which has an
approximately 200-word entry for "platform", with at least a couple of
dozen definitions, none of which can reasonably be interpreted as
having anything to do with the subject under discussion (except,
perhaps, the definition "a medium for discussion"(!), which doesn't get
us very far).
I won't attempt a rigorous definition of the term, but I've frequently
seen "platform" used to refer to the system hardware and software
supporting a given implementation of C. Surely at least one of those
dictionary entries is consistent with that usage? If not, it needs to
be updated. I went to www.ask.com and typed "what is a computer
platform" (it is clear that we were talking about "platform" in the
context of computers, right?), and recieved links to dozens of sites,
most of which confirmed that meaning.
That meaning fits very nicely the context in which Chris used the
term. I'm surprised that you're unfamiliar with this usage, and I'm
surprised that you gave any significant amount of thought to
considering the possibility that any other possible meaning applied.

Sep 8 '07 #42
kuyper said:

<snip>
Well, obviously he can't be referring to the hardware-only definition,
not if he's qualifying it with MS.
The world is larger than you realise.

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 9 '07 #43
Philip Potter <pg*@see.sig.in validwrote:
Richard Heathfield wrote:
Chris Hills said:
In article <ln************ @nuthaus.mib.or g>, Keith Thompson
<ks***@mib.orgw rites
void main()
Wrong. main returns int.
Not always but if we are assuming "conio.h" then it should
Whether main may return something other than int does *not* depend on
the availability or otherwise of a header named <conio.h>, but on
whether the implementation is a hosted C90 implementation.

Even on a freestanding implementation main may be required to return int.

Are hosted implementations free to accept void main(void) if they wish?
A hosted implementation is free to accept struct tm main(ptrdiff_t
bloogle), if it wishes to. That does not mean that one should use struct
tm main(ptrdiff_t bloogle), or even void main(), in C code posted to
this newsgroup, or anywhere else where one doesn't want to be tied to a
single implementation.

Richard
Sep 10 '07 #44

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

Similar topics

2
3383
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 that all data is scaled to and rendered on, and I display a smaller "window" of the canvas that the user can page through left and right. I've been able to scale my data (for the purposes of this discussion, x values are 0 - 2PI and y values...
14
3105
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 to do this? E.g. I want to be able to graph a function. At this point I'm not up to a level in C++ where I want to start learning Visual C++ so I don't want to go that route. Thanks
7
8745
by: Marc Pelletier | last post by:
Hello all, I have a class which includes a method to create a chart. I want to be able to call this method from asp.net code as well as windows application code, so I have sketched it out as returning a bitmap instance. In my asp.net code I think I should call this method to return a bitmap and then somehow stream it using the response object to the Webcontrols.image. Is that right? The image object is on a page with a number of...
0
1057
by: RamyaKarthik | last post by:
pls give some guide lines for developing project for online survey usin c++
1
1403
by: Ringo | last post by:
I need some help. I have an app that talks to a sonar board via the serial port. In my sp_DataReceived I gather all the data and put it into arrays. Then I want to draw the data in a pictureBox. I wrote a function called Draw_sonar2 that does all the drawing. It usually works but sometimes crashes saying the graphics object is already in use. After digging I saw that I should be doing the Drawing in the PB.paint, not a seperate function....
11
6739
by: Slickuser | last post by:
I have this function that will fill the ellipse every 10 seconds with specific x,y,w,h. Now I want do the the reverse, to clear the ellipse with given x,y using Timer at every 30s. Or I have put these (x,y,w,h) to an array? Later go back the array and fill ellipse with the same color as background? Is there an easy way?
6
4147
by: jt | last post by:
i think i was not clear in my quesiton. my question actually was how to store a graphics image generated in C. Eg. #include<graphics.h> void main() { int gm,gd=DETECT; initgraph(&gd,&gm,""); rectangle(50,50,200,300);
9
2667
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() From the Standard CreateGraphics() function the code below works
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.