Thursday, August 16, 2012
Add Multiple Email Signatures In Gmail For Each Email Id
Gmail is one of the most common free email service with high reliability, features and speedy interface on
both computers as well as mobile devices like smartphones and tablet. I
use Gmail all the time and I have added all my email IDs to one Gmail
account. We have previously shared a detailed tutorial to Send Emails From Gmail With Any Of Your Email Address.
If you are not already using this feature, I would suggest you to give
it a try. Also you can get the emails from different email ids into one Gmail inbox by setting forwarders in all your other email accounts for your Gmail account where you want to get all the emails.
Now I have one Gmail account for my work related as personal email
IDs which I use almost for all emailing purposes, and I realized that I
need different email signatures
for these different Ids. For example, If I am sending an email from my
Trouble Fixers id, I want it to show a link to www.troublefixers.com in
the email signature and for my other email ids, I want different
signatures. Interestingly, Gmail supports this feature as well. In this
article, I will show you steep by steep how to use custom email
signature with each email address added to Gmail.
Just follow these simple steps to set custom email signatures in Gmail web interface to set custom email signature for each of these email ids which you have in your account.
Step 1: Click on the settings icon on the Gmail web interface and click on Settings.
Step 2:
In settings go to General settings and scroll down to Signature
settings. There are two options here, No Signature and other one is the
option to select the email Id. Select the email id from the dropdown menu for which you want to set the signature.
Step 3:
In the text box below the selected email address, write down the email
signature for that email id. Repeat this for all the email Ids in which
you want a custom email signatures. Using this you can keep more fun signatures to your personal email ids and more formal ones to your work related email ids.
After you are done, scroll down to the end of general settings and press Save Changes button.
[Gmail Trick] Send Emails From Gmail With Any Of Your Email Address | Add All Your Email Addresses To Gmail
Trouble:
I have to access my personal email id, my trouble-fixers email id and
a few other email ids. If you have many email ids, you can make things
very simple by forwarding all those mails to one of your Gmail id. Gmail
is spacious and fast, so you will need not worry about logging into
multiple accounts. You can create filters to separate the emails you
receive from different email ids.
The tricky part is to reply to an email from another email id from
Gmail. In this article I will share the way how you can add another
gmail account to your Gmail account.
Fix:
Just follow these easy steps:
1. Sign into your Gmail Account, click on Settings >Accounts and Import Screen and click on “Send mail from another address” button.
2. Next screen will be a pop-up which will ask for Name and Email id, enter name and email id and click Next.
3. Next Screen will ask you for setting an SMTP server. Select the Gmail server, this is simple and straight forward.
4. Next screen will ask you to send a verification code, simple press
the “Send Verification” button. This is to ensure that its your own
email id.
5. Open your other email address you added in step 2, you will
receive an email like one below, it will have a code and a link. You can
either click the link or put the code in the screen below.
This will add the new address to your gmail. I suggest you to modify this setting just below the “Send mail from another address” button which is an option to reply from gmail and the same address.
That is all you need. Now when you compose an email with Gmail, you can select the email address from which you want to send it from.
This will add the new address to your gmail. I suggest you to modify this setting just below the “Send mail from another address” button which is an option to reply from gmail and the same address.
That is all you need. Now when you compose an email with Gmail, you can select the email address from which you want to send it from.
Hope you find the trick useful and productive.
[Solved] Cannot Remove USB Flash With Safely Remove Hardware Feature Not Working
There are times some of our users faced the problem when suddenly the
icon in task manager stopped working as nothing happening when users
click on the icon to remove the USB flash drive or any other removable drives and for some users the safely remove hardware icon in the windows taskbar disappeared.
After searching about this we came to know that this could happen
when the DLL files responsible for this feature are not working
correctly or gets damaged. Still there are many ways to fix this
problem, either you just need to run some commands in case you don’t see
the safely remove icon or just need to make sure that when you remove
the flash drive the you are not copying to or from the drive to computer
and also close the window showing the drive files when you unplug it
from USB port.
Method1: Safely Remove Hardware Icon Not Visible Or Missing ?
In such case the first thing you should try running the following command which brings back the safely remove hardware icon back in windows taskbar, even if you don’t see the icon back in system tray you will able to use the safely remove hardware feature using this command below in any versions of windows.
“C:\WINDOWS\system32\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll” [ run the command without quotes ]
If you need to run the above command every time you plug any USB
drive then you should better create a shortcut with the command above as
target path, so that you just need to double click the desktop shortcut when safely remove hardware does not respond when you click it or it does not appear in system tray.
Method 2: Do You Actually Need To Remove Every USB Removable Drive Safely Using Safe Remove Hardware Icon ?
No, unless you are doing some heavy copy of data to or from the USB
Drive, by default any USB drive you plug is optimised for quick removal,
so you can unplug the USB drive without using safely remove hardware. But don’t do it when some data transfer is going on to or from the USB drive to computer it is plugged in.
In order to enable a drive for better performance, you will need right click on the USB drive icon in My Computer and then -
- click the Hardware tab.
- click Properties.
- Now click on Policies tab.
If you want to do fast copy of data, you should enable this
feature but a power failure or sudden shutdown may result in loss of
data from the drive once you enable this feature. We suggest you not to
use this feature until you really need it.
Method 3: Alternative Way To Fix Safely Remove Hardware Not Working
This method is quite different as it may look like a possible
solution to many but it works perfectly for many windows users out there
who were facing this problem, as reported by users when they click the
icon of safely remove hardware list of USB devices does not pop up. You will not be able to access the devices and printers when this is happening at the following path Control Panel -> Hardware and Sound -> Devices and Printers.
Follow the procedure below to fix this, the simple solution to make
sure Bluetooth Support Service is running (even if you do not use
Bluetooth!)
1. Go to Start menu >> Run or press Window Key + R
2. Type services.msc and press ENTER
3. Scroll down to locate Bluetooth Support Service, right-click and select Start
4. Now, the safely remove hardware should be working again.
5. Restart your pc and Devices and Printers should load correctly as well.
2. Type services.msc and press ENTER
3. Scroll down to locate Bluetooth Support Service, right-click and select Start
4. Now, the safely remove hardware should be working again.
5. Restart your pc and Devices and Printers should load correctly as well.
If this problem appears again and again then go to the properties of
the Bluetooth Support Service and change its startup type to
Automatically (Delayed Start) as shown in the image below.
Find And/Or Change Default Location Of Saved Files In Microsoft Office Word, Excel, PowerPoint etc.
Most of Windows users come across Microsoft Office applications at times at their work, school or home depending
on their needs of work. MS office is one of the most popular softwares
used for creating computer documents, spreadsheets, presentations etc.
One of the common troubles faced by many of the new users is that they
don’t know where they saved the file on the computer after working on them for long time!
Imagine you open MS Word on your work or school or home computer, create a word document with lots of text, data pictures and spend good amount of time in making that document. Then you save that document with some name. Then you close MS Word and you realize that you don’t remember in which folder you saved the word document.
This is a common problem with new or first time users as they are not
very familiar with the software and file saving locations. In this small
article, we will share will you some very easy tips to locate the saved
files, or even change the default location to a folder of your choice
so that you don’t end up searching for your documents after you save
them.
How To Locate A File Saved In Microsoft Word, Excel Or PowerPoint?
First of all, when you save a file in Microsoft Office, the default location is usually My Documents or Documents folder
for most Windows PCs. But in many cases, it maybe different, before you
start following detailed steps, just open the My Documents or Documents
folder on windows computer where you saved the file and it might just be lying there silently.
If you don’t find the file in the folder, first you can check in the Recent Files options. For the same, click on File > Recent File. Here all the recent files with their locations are listed.
Also you can look at the Recent Places where some files have been saved. For example, in MS word, when you go to File > Open option, you see an option folder window in which you get an option called the Recent Places.
In case you don’t see your file in the recent places, which is a
possibility when many other files have been saved after you saved your
file last time, in that case, follow the below steps.
Step 1: Go to File > Options
Step 2:
On word options window, click on the Save tab on the left side pane. On
the right hand size, you will see the Default File location. This is
most likely the location your file is saved at. Open the location and
scroll to find your previously saved MS Word file. You can also use
search feature in Windows to search the file at that location.
Step 3:
If you want to change the default save location of your MS Word files,
you can simply click on the Browse button and select the new folder.
Keep a convenient location like desktop or some root folder where you
would like all your new documents to be saved and press Ok.
This is it. Same way you can make changes to the MS Excel options and
PowerPoint options and check the default file location for the new
files saved using MS Excel or MS PowerPoint software.
NOTE : The interface may look slightly different in different version
of Windows and MS Office, but the functionality is almost the same as
this is a fundamental option in all the version of Microsoft Office for Windows.
Draw shapes using c graphics
This
c graphics program draws basic shapes such as circle, line, rectangle,
ellipse and display text on screen using c graphics. This can be a first
graphics program for a beginner.
C programming code
#include<graphics.h> #include<conio.h> main() { int gd = DETECT,gm,left=100,top=100,right=200,bottom=200,x= 300,
y=150,radius=50; initgraph(&gd, &gm, "C:\\TC\\BGI"); rectangle(left, top, right, bottom); circle(x, y, radius); bar(left + 300, top, right + 300, bottom); line(left - 10, top + 150, left + 410, top + 150); ellipse(x, y + 200, 0, 360, 100, 50); outtextxy(left + 100, top + 325, "My First C Graphics Program"); getch(); closegraph(); return 0; }
Moving Wheel
#include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #include<dos.h> int l = 1; void ddaline(int x1, int y1, int x2, int y2) { int s, dx, dy, m; float xi, yi, x, y; dx = x2 - x1; dy = y2 - y1; if (abs(dx) > abs(dy)) s = abs(dx); else s = abs(dy); xi = dx / (float) s; yi = dy / (float) s; x = x1; y = y1; putpixel(x1 + 0.5, y1 + 0.5, 15); for (m = 0; m < s; m++) { x += xi; y += yi; putpixel(x + 0.5, y + 0.5, 15); } } void plotpoints1(int x, int y, int cx, int cy) { putpixel(cx + x, cy + y, 15); putpixel(cx - x, cy - y, 15); putpixel(cx - y, cy + x, 15); putpixel(cx + y, cy - x, 15); if (l % 20 == 0) { ddaline(cx - x, cy - y, cx + x, cy + y); ddaline(cx - y, cy + x, cx + y, cy - x); } l++; } void plotpoints2(int x, int y, int cx, int cy) { putpixel(cx - x, cy + y, 15); putpixel(cx + x, cy - y, 15); putpixel(cx + y, cy + x, 15); putpixel(cx - y, cy - x, 15); if (l % 20 == 0) { ddaline(cx + x, cy - y, cx - x, cy + y); ddaline(cx - y, cy - x, cx + y, cy + x); } l++; } void mcircle(int cx, int cy, int r) { int x = 0, y, p; y = r; p = 1 - r; while (x < y) { plotpoints1(x, y, cx, cy); x++; if (p < 0) p += 2 * x + 1; else { y--; p += 2 * (x - y) + 1; } } x = y + 1; while (abs(x) > 0) { plotpoints2(x, y, cx, cy); x--; if (p >= 0) p = p - 2 * x - 1; else { y++; p = p - 2 * (x - y) - 1; } } } void main() { int gd = DETECT, gm = DETECT; int i = 0; initgraph(&gd, &gm, ""); while (!kbhit()) { if (i > 640) i = -200; cleardevice(); mcircle(100 + (i++), 200, 100); delay(90); i++; } getch(); }
C graphics program moving car
#include <graphics.h> #include <dos.h> int main() { int i, j = 0, gd = DETECT, gm; initgraph(&gd,&gm,"C:\\TC\\BGI"); settextstyle(DEFAULT_FONT,HORIZ_DIR,2); outtextxy(25,240,"Press any key to view the moving car"); getch(); for( i = 0 ; i <= 420 ; i = i + 10, j++ ) { rectangle(50+i,275,150+i,400); rectangle(150+i,350,200+i,400); circle(75+i,410,10); circle(175+i,410,10); setcolor(j); delay(100); if( i == 420 ) break; if ( j == 15 ) j = 2; cleardevice(); // clear screen } getch(); closegraph(); return 0; }
Midpoint Circle Algorithm Using C Programming
#include<stdio.h>#include<conio.h>
#include<graphics.h>
void main()
{
#include<graphics.h>
void main()
{
int gd=DETECT,gm;}
int x,y,r;
void Drawcircle(int,int,int);
printf("Enter the Mid points and Radious:");
scanf("%d%d%d",&x,&y,&r);
initgraph(&gd,&gm,"");
Drawcircle(x,y,r);
getch();
closegraph();
void Drawcircle(int x1,int y1,int r)
{
int x=0,y=r,p=1-r;
void cliplot(int,int,int,int);
cliplot(x1,y1,x,y);
while(x<y)
{
x++;
if(p<0)
p+=2*x+1;
else
{
y--;
p+=2*(x-y)+1;
}
cliplot(x1,y1,x,y);
}
}
void cliplot(int xctr,int yctr,int x,int y)
{
{
putpixel(xctr +x,yctr +y,1);
putpixel(xctr -x,yctr +y,1);
putpixel(xctr +x,yctr -y,1);
putpixel(xctr -x,yctr -y,1);
putpixel(xctr +y,yctr +x,1);
putpixel(xctr -y,yctr +x,1);
putpixel(xctr +y,yctr -x,1);
putpixel(xctr -y,yctr -x,1);
getch();
}
3D Animation Computer Graphics Programs
1.3D Translation Program Using C Programming
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<process.h>
#include<graphics.h>
int x1,x2,y1,y2,mx,my,depth;
void draw();
void trans();
void main()
{
int gd=DETECT,gm,c;
initgraph(&gd,&gm,"d:\\tc\\bgi");
printf("\n\t\t3D Transmission\n\n");
printf("\nEnter 1st top value(x1,y1):");
scanf("%d%d",&x1,&y1);
printf("Enter right bottom value(x2,y2):");
scanf("%d%d",&x2,&y2);
depth=(x2-x1)/4;
mx=(x1+x2)/2;
my=(y1+y2)/2;
draw();
getch();
cleardevice();
trans();
getch();
}
void draw()
{
bar3d(x1,y1,x2,y2,depth,1);
}
void trans()
{
int a1,a2,b1,b2,dep,x,y;
printf("\n Enter the Ttransition Co ordinates:");
scanf("%d%d",&x,&y);
a1=x1+x;
a2=x2+x;
b1=y1+y;
b2=y2+y;
dep=(a2-a1)/4;
bar3d(a1,b1,a2,b2,dep,1);
setcolor(5);
draw();
}
2.3D Scaling Program Using C Programming
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<process.h>
#include<graphics.h>
int x1,x2,y1,y2,mx,my,depth;
void draw();
void scale();
void main()
{
int gd=DETECT,gm,c;
initgraph(&gd,&gm,"d:\\tc\\bgi");
printf("\n\t\t3D Transformation Scalling\n\n");
printf("\nEnter 1st top value(x1,y1):");
scanf("%d%d",&x1,&y1);
printf("Enter right bottom value(x2,y2):");
scanf("%d%d",&x2,&y2);
depth=(x2-x1)/4;
mx=(x1+x2)/2;
my=(y1+y2)/2;
draw();
getch();
cleardevice();
scale();
getch();
}
void draw()
{
bar3d(x1,y1,x2,y2,depth,1);
}
void scale()
{
int x,y,a1,a2,b1,b2,dep;
printf("\n\n Enter scalling co-ordinates:");
scanf("%d%d",&x,&y);
a1=mx+(x1-mx)*x;
a2=mx+(x2-mx)*x;
b1=my+(y1-my)*y;
b2=my+(y2-my)*y;
dep=(a2-a1)/4;
bar3d(a1,b1,a2,b2,dep,1);
setcolor(5);
draw();
}
3. 3D Rotation Program Using C Programming
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<process.h>
#include<graphics.h>
int x1,x2,y1,y2,mx,my,depth;
void draw();
void rotate();
void main()
{
int gd=DETECT,gm,c;
initgraph(&gd,&gm,"d:\\tc\\bgi");
printf("\n3D Transformation Rotating\n\n");
printf("\nEnter 1st top value(x1,y1):");
scanf("%d%d",&x1,&y1);
printf("Enter right bottom value(x2,y2):");
scanf("%d%d",&x2,&y2);
depth=(x2-x1)/4;
mx=(x1+x2)/2;
my=(y1+y2)/2;
draw();
getch();
cleardevice();
rotate();
getch();
}
void draw()
{
bar3d(x1,y1,x2,y2,depth,1);
}
void rotate()
{
float t;
int a1,b1,a2,b2,dep;
printf("Enter the angle to rotate=");
scanf("%f",&t);
t=t*(3.14/180);
a1=mx+(x1-mx)*cos(t)-(y1-my)*sin(t);
a2=mx+(x2-mx)*cos(t)-(y2-my)*sin(t);
b1=my+(x1-mx)*sin(t)-(y1-my)*cos(t);
b2=my+(x2-mx)*sin(t)-(y2-my)*cos(t);
if(a2>a1)
dep=(a2-a1)/4;
else
dep=(a1-a2)/4;
bar3d(a1,b1,a2,b2,dep,1);
setcolor(5);
//
draw();
}
2D Animation Computer Graphics Programs using C Language
1. 2D Scaling Program Using C Programming
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
int x1,y1,x2,y2,x3,y3,mx,my;
void draw();
void scale();
void main()
{
int gd=DETECT,gm;
int c;
initgraph(&gd,&gm," ");
printf("Enter the 1st point for the triangle:");
scanf("%d%d",&x1,&y1);
printf("Enter the 2nd point for the triangle:");
scanf("%d%d",&x2,&y2);
printf("Enter the 3rd point for the triangle:");
scanf("%d%d",&x3,&y3);
draw();
scale();
}
void draw()
{
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
}
void scale()
{
int x,y,a1,a2,a3,b1,b2,b3;
int mx,my;
printf("Enter the scalling coordinates");
scanf("%d%d",&x,&y);
mx=(x1+x2+x3)/3;
my=(y1+y2+y3)/3;
cleardevice();
a1=mx+(x1-mx)*x;
b1=my+(y1-my)*y;
a2=mx+(x2-mx)*x;
b2=my+(y2-my)*y;
a3=mx+(x3-mx)*x;
b3=my+(y3-my)*y;
line(a1,b1,a2,b2);
line(a2,b2,a3,b3);
line(a3,b3,a1,b1);
draw();
getch();
}
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
int x1,y1,x2,y2,x3,y3,mx,my;
void draw();
void scale();
void main()
{
int gd=DETECT,gm;
int c;
initgraph(&gd,&gm," ");
printf("Enter the 1st point for the triangle:");
scanf("%d%d",&x1,&y1);
printf("Enter the 2nd point for the triangle:");
scanf("%d%d",&x2,&y2);
printf("Enter the 3rd point for the triangle:");
scanf("%d%d",&x3,&y3);
draw();
scale();
}
void draw()
{
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
}
void scale()
{
int x,y,a1,a2,a3,b1,b2,b3;
int mx,my;
printf("Enter the scalling coordinates");
scanf("%d%d",&x,&y);
mx=(x1+x2+x3)/3;
my=(y1+y2+y3)/3;
cleardevice();
a1=mx+(x1-mx)*x;
b1=my+(y1-my)*y;
a2=mx+(x2-mx)*x;
b2=my+(y2-my)*y;
a3=mx+(x3-mx)*x;
b3=my+(y3-my)*y;
line(a1,b1,a2,b2);
line(a2,b2,a3,b3);
line(a3,b3,a1,b1);
draw();
getch();
}
2. 2D Rotation Program Using C Programming
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
void TriAngle(int x1,int y1,int x2,int y2,int x3,int y3);
void Rotate(int x1,int y1,int x2,int y2,int x3,int y3);
void main()
{
int gd=DETECT,gm;
int x1,y1,x2,y2,x3,y3;
initgraph(&gd,&gm," ");
printf("Enter the 1st point for the triangle:");
scanf("%d%d",&x1,&y1);
printf("Enter the 2nd point for the triangle:");
scanf("%d%d",&x2,&y2);
printf("Enter the 3rd point for the triangle:");
scanf("%d%d",&x3,&y3);
TriAngle(x1,y1,x2,y2,x3,y3);
getch();
cleardevice();
Rotate(x1,y1,x2,y2,x3,y3);
setcolor(1);
TriAngle(x1,y1,x2,y2,x3,y3);
getch();
}
void TriAngle(int x1,int y1,int x2,int y2,int x3,int y3)
{
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
}
void Rotate(int x1,int y1,int x2,int y2,int x3,int y3)
{
int x,y,a1,b1,a2,b2,a3,b3,p=x2,q=y2;
float Angle;
printf("Enter the angle for rotation:");
scanf("%f",&Angle);
cleardevice();
Angle=(Angle*3.14)/180;
a1=p+(x1-p)*cos(Angle)-(y1-q)*sin(Angle);
b1=q+(x1-p)*sin(Angle)+(y1-q)*cos(Angle);
a2=p+(x2-p)*cos(Angle)-(y2-q)*sin(Angle);
b2=q+(x2-p)*sin(Angle)+(y2-q)*cos(Angle);
a3=p+(x3-p)*cos(Angle)-(y3-q)*sin(Angle);
b3=q+(x3-p)*sin(Angle)+(y3-q)*cos(Angle);
printf("Rotate");
TriAngle(a1,b1,a2,b2,a3,b3);
}
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
void TriAngle(int x1,int y1,int x2,int y2,int x3,int y3);
void Rotate(int x1,int y1,int x2,int y2,int x3,int y3);
void main()
{
int gd=DETECT,gm;
int x1,y1,x2,y2,x3,y3;
initgraph(&gd,&gm," ");
printf("Enter the 1st point for the triangle:");
scanf("%d%d",&x1,&y1);
printf("Enter the 2nd point for the triangle:");
scanf("%d%d",&x2,&y2);
printf("Enter the 3rd point for the triangle:");
scanf("%d%d",&x3,&y3);
TriAngle(x1,y1,x2,y2,x3,y3);
getch();
cleardevice();
Rotate(x1,y1,x2,y2,x3,y3);
setcolor(1);
TriAngle(x1,y1,x2,y2,x3,y3);
getch();
}
void TriAngle(int x1,int y1,int x2,int y2,int x3,int y3)
{
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
}
void Rotate(int x1,int y1,int x2,int y2,int x3,int y3)
{
int x,y,a1,b1,a2,b2,a3,b3,p=x2,q=y2;
float Angle;
printf("Enter the angle for rotation:");
scanf("%f",&Angle);
cleardevice();
Angle=(Angle*3.14)/180;
a1=p+(x1-p)*cos(Angle)-(y1-q)*sin(Angle);
b1=q+(x1-p)*sin(Angle)+(y1-q)*cos(Angle);
a2=p+(x2-p)*cos(Angle)-(y2-q)*sin(Angle);
b2=q+(x2-p)*sin(Angle)+(y2-q)*cos(Angle);
a3=p+(x3-p)*cos(Angle)-(y3-q)*sin(Angle);
b3=q+(x3-p)*sin(Angle)+(y3-q)*cos(Angle);
printf("Rotate");
TriAngle(a1,b1,a2,b2,a3,b3);
}
3. 2D Translation Triangle Program Using C Programming
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
int x1,y1,x2,y2,x3,y3,mx,my;
void draw();
void tri();
void main()
{
int gd=DETECT,gm;
int c;
initgraph(&gd,&gm,"d:\\tc\\bgi ");
printf("Enter the 1st point for the triangle:");
scanf("%d%d",&x1,&y1);
printf("Enter the 2nd point for the triangle:");
scanf("%d%d",&x2,&y2);
printf("Enter the 3rd point for the triangle:");
scanf("%d%d",&x3,&y3);
cleardevice();
draw();
getch();
tri();
getch();
}
void draw()
{
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
}
void tri()
{
int x,y,a1,a2,a3,b1,b2,b3;
printf("Enter the Transaction coordinates");
scanf("%d%d",&x,&y);
cleardevice();
a1=x1+x;
b1=y1+y;
a2=x2+x;
b2=y2+y;
a3=x3+x;
b3=y3+y;
line(a1,b1,a2,b2);
line(a2,b2,a3,b3);
line(a3,b3,a1,b1);
}
4. 2D Translation Rectangle Program Using C Programming
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
void RectAngle(int x,int y,int Height,int Width);
void Translate(int x,int y,int Height,int Width);
void main()
{
int gd=DETECT,gm;
int x,y,Height,Width;
initgraph(&gd,&gm," ");
printf("Enter the First point for the Rectangle:");
scanf("%d%d",&x,&y);
printf("Enter the Height&Width for the Rectangle:");
scanf("%d%d",&Height,&Width);
RectAngle(x,y,Height,Width);
getch();
cleardevice();
Translate(x,y,Height,Width);
RectAngle(x,y,Height,Width);
getch();
}
void RectAngle(int x,int y,int Height,int Width)
{
line(x,y,x+Width,y);
line(x,y,x,y+Height);
line(x+Width,y,x+Width,y+Height);
line(x,y+Height,x+Width,y+Height);
}
void Translate(int x,int y,int Height,int Width)
{
int Newx,Newy,a,b;
printf("Enter the Transaction coordinates");
scanf("%d%d",&Newx,&Newy);
cleardevice();
a=x+Newx;
b=y+Newy;
RectAngle(a,b,Height,Width);
}
Subscribe to:
Posts (Atom)