Simple application of a small piano - graphical interface and vocalization technology

xiaoxiao2021-03-06  42

A small piano - a graphical interface and sound technology, simple application Issue Date: July 17, 2004 Author: Lam Yik Wei has 2975 reader read the article / * * Super Piano, Version 1.0 * Compiled by TCC.EXE * Coding enviroment: Win-TC 1.72 * Written by Lin yiwei, from zju * Date: 2004-7-17 * / #include

#include

#include

#include

#define closegr closegraph #define KEY_WIDTH 60 #define KEY_HEIGHT 280 #define s 8051 #define d 8292 #define f 8550 #define g 8807 #define h 9064 #define j 9322 #define k 9579 #define ESC 283 / * function's prototype * / void initgr () {int gd = DETECT, gm = 0; registerbgidriver (EGAVGA_driver); / * register BGI driver * / registerbgifont (triplex_font); / * register BGI font * / registerbgifont (small_font); registerbgifont (sansserif_font); registerbgifont ( Gothic_Font); INITGRAPH (& GD, & GM, ");} / * Initialize the graphic * / void down (int x, int y) {setColor (White); setFillStyle (Solid_Fill, White); bar (x, y, x KEY_WIDTH, y KEY_HEIGHT-13); setcolor (DARKGRAY); setfillstyle (SOLID_FILL, DARKGRAY); bar (x, y KEY_HEIGHT-13, x KEY_WIDTH, y KEY_HEIGHT);} / * the key being pressed * / Void Up (int X, int y) {setColor (White); setfillstyle; bar (x, y, x key_width, y key_height-20); setColor (Darkgray); setFillStyle (Solid_Fill, Darkgray) Bar (x, y key_height-20, x key_width, y key_height);} / * the key being release * / void s Tart () {Int i = 0; initage (); / * Initialize the bgi * / setbkcolor (lightgray); / * set the background * / settextStyle (4, 0, 5); setColor (blue); Outtextxy (170, 40, "Super Piano"); setColor (red); Outtextxy (172, 42, "super piano); setColor (YELLOW); Outtextxy (174, 44," super piano); setColor (Green); Outtextxy (176 , 46, "Super Piano"); / * this is the title * / for (i = 0; i <7; i ) {UP (100 i * (Key_Width 5), 110);} / * the key * / setTextStyle (0, 0, 1); setColor (Lightred); Outtextxy (175, 420, "Key: 1-S, 2-D, 3-F, 4-G, 5-H, 6-J, 7-K , Quit-esc "); setColor (Blue); Outtextxy (215, 440," All Rights Reverse @ 2004-7);} main () {INT i = 0;

转载请注明原文地址:https://www.9cbs.com/read-51454.html

New Post(0)