سورس ساعت گرافیکی به زبان C
در این پست برای شما کاربران گرامی سورس ساعت گرافیکی به زبان C را آماده کرده ایم.
جهت مشاهده جزئیات کامل سورس ساعت گرافیکی به زبان C لطفا به ادامه مطلب مراجعه فرمائید.
تکه کد سورس ساعت گرافیکی به زبان C:
1 | <span style="color: #ff0000;"><strong>جهت دریافت کد کامل این برنامه لطفا از بخش خرید محصول اقدام کنید</strong></span> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | #include <stdio.h> #include <graphics.h> #include <conio.h> #include <math.h> #include <stdlib.h> #include <dos.h> void clock(); int main() { int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, ""); errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %sn", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); } clock(); getch(); return 0; } void clock() { struct time t; unsigned int h, m, s, d, i, j; float x, y, z; char ch; setcolor(15); setlinestyle(0, 0 , 3); rectangle(10, 10, 630, 470); /*sound(300); delay(100); nosound(); */ setfillstyle(9, 1); fillellipse(320, 240, 220, 220); setcolor(15); setlinestyle(0, 0, 0); circle(320, 240, 225); setcolor(4); setlinestyle(0, 0, 2); circle(320, 240, 220); settextstyle(7, 0, 4); setcolor(2); outtextxy(277, 92, "Yasob"); setcolor(11); outtextxy(275, 90, "Yasob"); setcolor(2); outtextxy(277, 320, "Saify"); setcolor(11); outtextxy(274, 319, "Saify"); settextstyle(1, 0, 5); setcolor(0); outtextxy(296, 26, "12"); outtextxy(506, 213, "3"); outtextxy(316, 411, "6"); outtextxy(116, 213, "9"); setcolor(14); outtextxy(295, 25, "12"); outtextxy(505, 212, "3"); outtextxy(315, 410, "6"); outtextxy(115, 212, "9"); setcolor(4); setfillstyle(1, 4); fillellipse(320, 240, 9, 9); setcolor(11); setfillstyle(9, 11); fillellipse(430, 67, 5, 5); fillellipse(500, 145, 5, 5); fillellipse(500, 335, 5, 5); fillellipse(430, 412, 5, 5); fillellipse(137, 335, 5, 5); fillellipse(207, 412, 5, 5); fillellipse(207, 67, 5, 5); fillellipse(137, 145, 5, 5); setwritemode(1); gettime(&t); h = t.ti_hour; m = t.ti_min; s = t.ti_sec; if(h > 12) h = h - 12; setcolor(12); setlinestyle(0, 0, 0); z = (s / 9.549304) - 1.6707; line(320 + int(10 * cos(z)), 240 + int(10 * sin(z)), 320 + int(210 * cos(z)), 240 + int(210 * sin(z))); setcolor(14); setlinestyle(0, 0, 3); y = (m / 9.549304) - 1.6707; line(320 + int(10 * cos(y)), 240 + int(10 * sin(y)), 320 + int(190 * cos(y)), 240 + int(190 * sin(y))); x = ((h / 1.90986) - 1.5707) + ((t.ti_min / 9.549) /12); line(320 + int(10 * cos(x)), 240 + int(10 * sin(x)), 320 + int(140 * cos(x)), 240 + int(140 * sin(x))); |




















(325 امتیاز از 93 رای)