日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

C语言绘画示例-进度条

發(fā)布時間:2023/12/18 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 C语言绘画示例-进度条 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.


C語言繪圖示例-進(jìn)度條

各種應(yīng)用程序、應(yīng)用軟件啟動時都有裝載進(jìn)度顯示的進(jìn)度條。媒體播放器也有提示播放進(jìn)度的進(jìn)度條。還有打開網(wǎng)頁時有名的”轉(zhuǎn)呀轉(zhuǎn)呀”的進(jìn)度顯示環(huán)形圖。

本人喜歡自制進(jìn)度條,體驗(yàn)繪畫的樂趣,感到很有成就感。試制了幾款進(jìn)度條,今將繪圖方法分享給大家,希望大家喜歡。

我空余時在安卓手機(jī)上用myspringc語言編寫的C語言繪圖示例,可供喜歡的朋友參考。我編制的這個進(jìn)度條示例程序最大的優(yōu)點(diǎn)是可以演示動態(tài)顯示進(jìn)度條過程,頗具觀賞性。

MySpringC不僅可以編寫簡單的C語言程序,而且它能讀取手機(jī)中各種傳感器的數(shù)值,控制各種多媒體設(shè)備,從而實(shí)現(xiàn)讓普通用戶用C語言控制手機(jī),編寫出意想不到的、適合自己使用的應(yīng)用。

以下是源碼:(附示例圖)
// ?最簡單的 C 語言編程
// ?myspringc ?v2.7 ?可編譯安卓本機(jī) app 應(yīng)用
// ?此樣例可復(fù)制黏貼到 myspringc ?編譯
// ?此文檔可用 VB,VC ?, ?java 改寫
//***************************************
//**** ? ? ?C語言繪圖示例-進(jìn)度條 ? ? ? ?*******
//***************************************
Canvas cs ; ? ? //畫布
string sBarDes[10];
int nBarId[10];
string sMenu[50];
int nMenu[50];
float src[4]; ?//ClearDraw (cls) clear screen
string fname; ?//filename,load picture
string s,ss,ss1,ss2,ss3;
int sx,sy,dx,dy;
?int size[2];
int i,j,d;
int n,t,k; ? ?//t=times,n=number
int sn; ? ?//mode number
?int r1,g1,b1; ? ? //16m 全色調(diào)色板
float x0,y0,x1,y1;
float px,py,sx1,sy1,sx2,sy2;
float pi=3.1415926535;
double L,a;
int sec,min;
string s$,m$;

main(){
setDisplay(1);
? cs.SetBackground(150,150,150);
? cs.Active();

? ?sBarDes[0]="演 ?示";
? ?nBarId[0]=100;
? ?sBarDes[1]="上一例 ";
? ?nBarId[1]=101;
? ?sBarDes[2]="下一例 ";
? ?nBarId[2]=102;
? ?sBarDes[3]=" ?";
? ?nBarId[3]=103;
? ?sBarDes[4]="退出程序";
? ?nBarId[4]=104;
? ?sBarDes[5]=" ";
? ?nBarId[5]=105;
? ?setToolBarHeight(6);
? ?setButtonTextSize(14);
? ?setToolBarBackgroundColor(255,192,192,192);
? ?setButtonColor(255,0,0,240);
? ?setButtonTextColor(255,255,255,0);
? ?setToolBar(100,myToolBarProc,sBarDes,nBarId,6);

? setTitle("C語言繪圖示例 ? ");
? sn=17; ? ? show_pad(); ? ? //程序啟動時即時繪出
while (){}
? }//main ()

show_pad (){ //演示例序
? ? if (sn==1) bar1 ();
? ? if (sn==2) bar2 ();
? ? if (sn==3) bar3 ();
? ? if (sn==4) bar4 ();
? ? if (sn==5) bar5 ();
? ? if (sn==6) bar6 ();
? ? if (sn==7) bar7 ();
? ? if (sn==8) bar8 ();
? ? if (sn==9) bar9 ();
? ? if (sn==10) bar10 ();
? ? if (sn==11) bar11 ();
? ? if (sn==12) bar12 ();
? ? if (sn==13) bar13 ();
? ? if (sn==14) bar14 ();
? ? if (sn==15) bar15 ();
? ? if (sn==16) bar16 ();
? ? if (sn==17) bar17 ();
? ? if (sn==18) bar18 ();

}//show_pad ()

bar18(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,150,150,150);
? ? ? ?cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? ?cs.SetColor (255,220,220,220); ?
? ? ? ? ?cs.DrawCircle (i*2+113,385,20); ? }
? ? for (i=0;i<201;i++){ ?//彩色底色
? ? ? ? ?cs.SetColor (255,255-i/2,i+50,120);
? ? ? ? ?cs.DrawCircle (i*2+113,385,18); ? ?}
? ? ? ? ?cs.Update ();

? ?for (i=0;i<101;i++){ ?//進(jìn)度條 (18) ??
? ? ? ?cs.SetColor (255,240,240,240); ? ?//mask
? ? ? ? cs.DrawCircle (i*4+111,385,12); ??
? ?for (d=0;d<12;d++){ ? //變色珠
? ? ? ?cs.SetColor (255,255-d*6,150-d*6,0);
? ? ? ?cs.DrawCircle (i*4+115,385,12-d); ? ? }
? ? ? ?if ((i-i/3*3)==0&&i>3) {
? ?for (j=0;j<5;j++){ ? ?//draw bar
? ? ? ? cs.SetColor (255,255-i*2,i*2+50,120);
? ? ? ? cs.DrawLine(i*4+95+j,377,i*4+90+j,393); ? ?} ? }

? ? ? ?cs.SetColor (255,150,150,150); ?//clear
? ? ? ? ?cs.DrawRect(537,367,620,403) ; ? ?
? ? ? ? ? ? ? n=(int)(i ) ;
? ? ? ? ? ? ? ?if(n<100) {k=15; }else{k=0 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540+k,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ?cs.SetColor (255,150,150,150); ?//clear text
? ? ? ?cs.DrawRect (100,300,320,358) ;
? ? ?cs.SetColor (255,250,250,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar18()

?

bar17(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? fname="/storage/emulated/0/m01.jpg";
? cs.DrawBitmap(fname,0,2); ? //加底圖
? ? ? ? cs.SetColor (255,120,30,0); ? //底色
? ? ? ? cs.DrawRect (0,330,720,420);
? ? ? ? ? ? cs.SetStrokeWidth(1);
? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? //cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? cs.DrawText ("音樂播放器> ?北國之春 ",400,320);
? ? cs.DrawText ("演唱:千昌夫 ",400,345);

? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,55);
? ? ? ? cs.DrawText ("Play......" ,120,360);
? ? ?for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? ?cs.SetColor (255,20,20,20); ?
? ? ? ? ?cs.DrawCircle (i*2+113,385,3); ? }
? ? ? ? ? ?cs.Update ();

? ? for (i=0;i<101;i++){ ?//進(jìn)度條 (17) ??
? ? ?cs.SetColor (255,120,30,0); ? ?//mask
? ? ?cs.DrawRect (100,373,i*4+115,380); ??
? ? ?cs.DrawRect (100,390,i*4+115,397 ); ??
? ? ? ? cs.SetColor(225,i*2+55,i+50,250); ?// bar?
? ? ? ? cs.DrawCircle (i*4+117,385,9); ? ?
? ? ? ? cs.SetColor (255,20,20,20); ?
? ? ? ? cs.DrawCircle (i*4+117,385,5); ? ??
? sleep (5);
? ? ? ?cs.SetColor (255,120,30,0); ?//clear
? ? ? ? ?cs.DrawRect(537,367,620,403) ; ? ?
? ? ? ? ?cs.DrawRect(30,367,99,403) ; ? ?
? ? ? ? ? ? ?sec=(i*2)/60 ; ? //show times
? ? ? ? ? ? ?min=(i*2)-sec*60;
? ? ? ? ? ? ?s$=intToString (sec);
? ? ? ? ? ? ?if (sec<10) s$="0"+s$;
? ? ? ? ? ? ?m$=intToString (min);
? ? ? ? ? ? ?if (min<10) m$="0"+m$;
? ? ? ? ? ? ?ss=s$+":"+m$;
? ? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? ? cs.SetTextSize (18); ? ?
? ? ? ? ? cs.DrawText ("03:20",532,391);
? ? ? ? ? cs.DrawText (ss,56,391);
? ? ? ? ? cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ?// ?cs.SetColor (255,120,30,0); ?//clear text
? ? ? ?//cs.DrawRect (100,300,320,367) ;
? ? ?cs.SetColor (255,250,250,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色漸變進(jìn)度條示例",160,530);
? ? ?cs.Update ();
}//bar17()

?

bar16(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,150,150,150);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,290,450);
? ? ?//**** draw program bar
?L=70;
px=360;
py=300;
? ? ?cs.SetColor(225,250,250,250); ? //底色
? ? ?cs.DrawCircle(px,py,90);
? ? ? cs.SetColor(225,240,240,240); ? //底色
? ? ?cs.DrawCircle(px,py,88);
? ? cs.SetColor(225,220,220,220);
? ? ?cs.DrawCircle(px,py,51);
? ?for (i=0;i<201;i++){ ? ?// Draw "O"
? ? ? ?if ((i-i/10*10)==0) {
? ? ? ?for (j=0;j<6;j++){
? ? ? ? ? cs.SetStrokeWidth(6);
? ? ? ? ?a=pi/200*(j+i)*2;
? ? ? ? ? sx1=(float)(px+(L-15)*sin (a));
? ? ? ? ? sy1=(float)(py-(L-15)*cos (a));
? ? ? ? ? sx2=(float)(px+(L+14)*sin (a));
? ? ? ? ? sy2=(float)(py-(L+14)*cos (a));
? ? ?cs.SetColor(225,i*2-155,i+20,180); ?//draw bar line
? ? ? ? ? ?cs.DrawLine (sx1,sy1,sx2,sy2); ?} ? ? }
??
? ? ? ? ?cs.SetColor(225,100,100,100); ?//clear
? ? ? ? ?cs.DrawCircle(px,py,51);
? ? ? ? ? ? ? n=(int)(i/2) ; ? ? ? ? ? ??
? ? ? ? ? ? ? if(n==100) {k=0; }else{k=10 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ? ss=intToString (n)+"%" ;
? ? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? ? cs.SetTextSize (24); ? ?
? ? ? ? ? cs.DrawText (ss,330+k,309);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ? ? } ? //draw bar ?
? ? ? ? cs.SetColor (255,150,150,150); ?//clear text
? ? ? ? cs.DrawRect (270,400,450,460) ;
? ? ?cs.SetColor (255,250,250,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 環(huán)形進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar16()

?

bar15(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(3);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,150,150,150);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,290,450);
? ? ?//**** draw program bar
?L=70;
px=360;
py=300;
? ? ?cs.SetColor(225,250,250,250); ? //底色
? ? ?cs.DrawCircle(px,py,90);
? ? ? cs.SetColor(225,20,20,20); ? //底色
? ? ?cs.DrawCircle(px,py,88);
? ? cs.SetColor(225,240,240,240);
? ? ?cs.DrawCircle(px,py,51);
? ?for (i=0;i<201;i++){ ? ?// Draw "O"
? ? ? ? ? a=pi/200*i*2;
? ? ? ? ? sx1=(float)(px+(L-15)*sin (a));
? ? ? ? ? sy1=(float)(py-(L-15)*cos (a));
? ? ? ? ? sx2=(float)(px+(L+14)*sin (a));
? ? ? ? ? sy2=(float)(py-(L+14)*cos (a));
? ? ?cs.SetColor(225,i+55,i+20,180); ?//draw bar line
? ? ? ? ? ?cs.DrawLine (sx1,sy1,sx2,sy2);
??
? ? ? ? ?cs.SetColor(225,240,240,240); ?//clear
? ? ? ? ?cs.DrawCircle(px,py,51);
? ? ? ? ? ? ? n=(int)(i/2) ; ? ? ? ? ? ??
? ? ? ? ? ? ? if(n==100) {k=0; }else{k=10 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ? ss=intToString (n)+"%" ;
? ? ? ? ? cs.SetColor (255,250,20,0);
? ? ? ? ? cs.SetTextSize (24); ? ?
? ? ? ? ? cs.DrawText (ss,330+k,309);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ? ? } ? //draw bar ?
? ? ? ? cs.SetColor (255,150,150,150); ?//clear text
? ? ? ? cs.DrawRect (270,400,450,460) ;
? ? ?cs.SetColor (255,250,250,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 環(huán)形進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar15()

?

bar14(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(1);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,150,150,150);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,290,450);
? ? ?//**** draw program bar
?L=70;
px=360;
py=300;
? ? ?cs.SetColor(225,20,20,20); ? //底色
? ? ?cs.DrawCircle(px,py,88);
? ? ?cs.SetColor(225,240,240,240);
? ? ?cs.DrawCircle(px,py,51);
? ? ?cs.SetFillMode (0);//0不填色,1填色
? ? ?cs.SetColor(225,200,200,200); ? //底色
? ? ?cs.DrawCircle(px,py,82);
? ? ? cs.SetFillMode (1);//0不填色,1填色
? ?for (i=0;i<201;i++){ ? ?// Draw "O"
? ? ? ? ? a=pi/200*i*2;
? ? ? ? ? sx1=(float)(px+L*sin (a));
? ? ? ? ? sy1=(float)(py-L*cos (a));
? ? ? ? cs.SetColor(225,i+55,i+10,150);
? ? ? ? cs.DrawCircle(sx1,sy1,13);
? ? ? ? cs.SetColor(225,250,20,50);
? ? ? ? cs.DrawCircle(sx1,sy1,9);

? ? ? ? ?cs.SetColor(225,240,240,240); ?//clear
? ? ? ? ?cs.DrawCircle(px,py,51);
? ? ? ? ? ? ? n=(int)(i/2) ; ? ? ? ? ? ??
? ? ? ? ? ? ? if(n==100) {k=0; }else{k=10 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ? ss=intToString (n)+"%" ;
? ? ? ? ? cs.SetColor (255,250,20,0);
? ? ? ? ? cs.SetTextSize (24); ? ?
? ? ? ? ? cs.DrawText (ss,330+k,309);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ? ? } ? //draw bar ?
? ? ? ? cs.SetColor (255,150,150,150); ?//clear text
? ? ? ? cs.DrawRect (270,400,450,460) ;
? ? ?cs.SetColor (255,250,250,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 環(huán)形進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar14()

?

bar13(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,150,150,150);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,290,450);
? ? ?//**** draw program bar
?L=70;
px=360;
py=300;
? ?cs.SetColor(225,200,200,200); ? //底色
? ? ?cs.DrawCircle(px,py,90);
? ?cs.SetColor(225,240,240,240);
? ? ?cs.DrawCircle(px,py,50);

? ? for (i=0;i<201;i++){ ? ?// Draw "O"
? ? ? ? ?a=pi/200*i*2;
? ? ? ? ?sx1=(float)(px+L*sin (a));
? ? ? ? ?sy1=(float)(py-L*cos (a));
? ? ? ? cs.SetColor(225,i+50,200-i,i);
? ? ? ? cs.DrawCircle(sx1,sy1,13);
? ? ? ? cs.SetColor(225,250,200,50);
? ? ? ? cs.DrawCircle(sx1,sy1,9);

? ? ? ? ?cs.SetColor(225,240,240,240); ?//clear
? ? ? ? ?cs.DrawCircle(px,py,50);
? ? ? ? ? ? ? n=(int)(i/2) ; ? ? ? ? ? ??
? ? ? ? ? ? ? if(n==100) {k=0; }else{k=10 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ? ss=intToString (n)+"%" ;
? ? ? ? ? cs.SetColor (255,250,20,0);
? ? ? ? ? cs.SetTextSize (24); ? ?
? ? ? ? ? cs.DrawText (ss,330+k,309);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ? ? } ? //draw bar ?
? ? ? ? cs.SetColor (255,150,150,150); ?//clear text
? ? ? ? cs.DrawRect (270,400,450,460) ;
? ? ?cs.SetColor (255,250,250,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 環(huán)形進(jìn)度條示例",220,500);
? ? ?cs.Update ();
}//bar13()

?

bar12(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,150,150,150);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("LOADING......" ,100,350);
? ? ?for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? cs.SetColor (255,0,20,20); ?
? ? ? ? cs.DrawCircle (i*2+112,384,19); ? }
? ? ?for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,250,250,250); ?
? ? ? ? cs.DrawCircle (i*2+114,385,19); ? }
? ? ? for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,220,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,384,18); ? }
? ? ? for (i=0;i<201;i++){ ?//底色
? ? ? ?cs.SetColor (255,150,150,150); ?
? ? ? ? cs.DrawCircle (i*2+113,385,5); ? }

? ? ? ? ? ?cs.Update ();
? ? for (i=0;i<201;i++){ ?//進(jìn)度條 (12) ? ??
? ? ? ? ? ?cs.SetColor (255,220,220,220); ?//mask
? ? ? ? cs.DrawOval (i*2+112,385,9,13,0); ?

? ? ? ?cs.SetColor (255,55+i,10+i,150);
? ? ? ?cs.DrawCircle (i*2+110,385,8); ?
? ? ? cs.SetColor (255,55,10,50);
? ? // ? cs.DrawCircle (i*2+110,385,3); ?

? ? ?for (d=0;d<12;d++){ ? //變色珠
? ? ? ? ? cs.SetColor (255,255-d*12,125,100);
? ? ? ? ?cs.DrawCircle (i*2+115,385,11-d); ? }

? ? ? ? ?cs.SetColor (255,150,150,150); ?//clear
? ? ? ? ?cs.DrawRect(537,367,620,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ?if(n<100) {k=15; }else{k=0 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540+k,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,150,150,150); ?//clear text
? ? ? ? cs.DrawRect (100,300,320,358) ;
? ? ?cs.SetColor (255,250,250,0);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar12()

?

bar11(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,150,150,150);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("LOADING......" ,100,350);
? ? ?for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? cs.SetColor (255,0,20,20); ?
? ? ? ? cs.DrawCircle (i*2+112,384,19); ? }
? ? ?for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,250,250,250); ?
? ? ? ? cs.DrawCircle (i*2+114,385,19); ? }
? ? ? for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,220,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,384,18); ? }
? ? ? for (i=0;i<201;i++){ ?//底色
? ? ? ?cs.SetColor (255,80,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,3); ? }

? ? ? ? ? ?cs.Update ();
? ? for (i=0;i<201;i++){ ?//進(jìn)度條 (11)?
? ? ? ? ?cs.SetColor (255,255-i/2,i+50,120);
? ? ? ?cs.DrawCircle (i*2+113,385,9); ?
? ? ? ? cs.SetColor (255,255-i/4,i+55,90);
? ? ? ?cs.DrawCircle (i*2+109,385,8); ?
?
? ? ? ? cs.SetColor (255,220,220,220); ?//mask
? ? ? ? ?cs.DrawOval (i*2+111,385,8,12,0); ?
? ? ?for (d=0;d<12;d++){ ? //變色珠
? ? ?cs.SetColor (255,255-d*10,105,205);
? ? ? ? ?cs.DrawCircle (i*2+115,385,11-d); ? }

? ? ? ? ?cs.SetColor (255,150,150,150); ?//clear
? ? ? ? ?cs.DrawRect(537,367,620,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ?if(n<100) {k=15; }else{k=0 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,250,0);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540+k,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,150,150,150); ?//clear text
? ? ? ? cs.DrawRect (100,300,320,358) ;
? ? ?cs.SetColor (255,200,200,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar11()

?

bar10(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ?for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? cs.SetColor (255,0,120,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,19); ? }
? ? ?for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,120,120,120); ?
? ? ? ? cs.DrawCircle (i*2+113,385,17); ? }
? ? ? for (i=0;i<201;i++){ ?//底色
? ? ? ?cs.SetColor (255,80,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,3); ? }
? ? ? ? ? ?cs.Update ();
? ? for (i=0;i<201;i++){ ?//進(jìn)度條 (10)?
? ? ? ? ?cs.SetColor (255,255-i/2,i+50,120);
? ? ? ? ?cs.DrawCircle (i*2+113,385,9); ?
? ? ? ? cs.SetColor (255,255-i/4,i+55,90);
? ? ? ? ?cs.DrawCircle (i*2+109,385,8); ?
? ? ? cs.SetColor (255,0,120,120);
? ? ? ? ?cs.DrawCircle (i*2+110,385,7); ?

? ? ? ? cs.SetColor (255,120,120,120);
? ? ? ? ?cs.DrawOval (i*2+111,385,8,12,0); ?
? ? ?for (d=0;d<12;d++){ ? //變色珠
? ? ?cs.SetColor (255,255-d*10,255-d*10,255);
? ? ? ? ?cs.DrawCircle (i*2+115,385,11-d); ? }

? ? ? ? ?cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect(535,367,600,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,0,120,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar10()

?

bar9(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ? ? cs.SetColor (255,120,120,120); ?
? ? for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? cs.SetColor (255,0,120,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,19); ? }
? ? ?for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,220,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,17); ? }
? ? ? for (i=0;i<201;i++){ ?//底色
? ? ? ?cs.SetColor (255,80,120,220); ?
? ? ? ?cs.DrawCircle (i*2+113,385,4); ? ? }
? ? ? ? ? ?cs.Update ();

? ? for (i=0;i<201;i++){ ?//進(jìn)度條 (9)?
? ? ? ? cs.SetColor (255,255-i/5,i+50,120);
? ? ? ? cs.DrawCircle (i*2+113,380,4); ?
? ? ? ? cs.SetColor (255,255-i,i/2+50,120);
? ? ? ? cs.DrawCircle (i*2+114,386,8); ?
? ? ? ? cs.SetColor (255,255-i/2,i+50,120);
? ? ? ? cs.DrawCircle (i*2+112,385,6); ?
? ? ? ? cs.SetColor (255,250,20,20); ?
? ? ? ? cs.DrawCircle (i*2+113,385,5);?
? ? ?cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect(535,367,600,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,0,120,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar9()

?

bar8(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ? ? cs.SetColor (255,120,120,120); ?
? ? for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? cs.SetColor (255,0,120,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,19); ? }
? ? ?for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,220,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,17); ? }
? ? ? for (i=0;i<201;i++){ ?//底色
? ? ? ?cs.SetColor (255,80,120,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,5); ? }
? ? ? ? ? ?cs.Update ();
? ? for (i=0;i<201;i++){ ?//進(jìn)度條 (8)?
? ? ? ? ?cs.SetColor (255,255-i/2,i+50,120);
? ? ? ? ?cs.DrawCircle (i*2+113,385,9); ?
? ? ? ? cs.SetColor (255,255-i ,i+55,90);
? ? ? ? ?cs.DrawCircle (i*2+110,385,7); ?
? ? ? ?cs.SetColor (255,255,0,0);
? ? ? ? ?cs.DrawCircle (i*2+113,385,5); ?

? ? ? ? ?cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect(535,367,600,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,0,120,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar8 ()

?

bar7(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ? ? cs.SetColor (255,120,120,120); ?
? ? for (i=0;i<202;i++){ ?//進(jìn)度條框底色
? ? ? ? cs.SetColor (255,0,120,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,19); ? }
? ? ?for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,220,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,17); ? }
? ? ? for (i=0;i<201;i++){ ?//底色
? ? ? ?cs.SetColor (255,80,120,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,5); ? }
? ? ? ? ? ?cs.Update ();
? ? for (i=0;i<201;i++){ ?//進(jìn)度條 (7)?
? ? ? ? ?cs.SetColor (255,255-i/2,i+50,120);
? ? ? ? ?cs.DrawCircle (i*2+113,385,9); ?
? ? ? ? cs.SetColor (255,255-i ,i+55,90);
? ? ? ? ?cs.DrawCircle (i*2+110,385,7); ?

? ? ? ? ?cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect(535,367,600,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,0,120,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 三色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar7 ()

?

bar6(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,50,50,100);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,290,420);
? ? ?//**** draw program bar
?L=60;
px=360;
py=300;
t=0;
replay: ? ? ?//
? ?for (i=-2;i<201;i++){ ? ?// Draw "O"
? ? ? ?if ((i-i/4*4)==0) {
? ? ? ? ?cs.SetStrokeWidth(3);
? ? ? ? ?a=pi/200*(j+i)*2;
? ? ? ? ? sx1=(float)(px+(L-17)*sin (a));
? ? ? ? ? sy1=(float)(py-(L-17)*cos (a));
? ? ? ? ? sx2=(float)(px+(L+12)*sin (a));
? ? ? ? ? sy2=(float)(py-(L+12)*cos (a));
? ? ?cs.SetColor(225,i*2+55,i+50,160); ?//draw bar line
? ? ? ? ? ?cs.DrawLine (sx1,sy1,sx2,sy2); ?} ? // ?}?
? ? ? ? ?cs.SetColor(225,250,250,250); ?//clear
? ? ? ? ?cs.DrawCircle(px,py,40);
? ? ? ? ? ? ? n=i/10+t*20 ; ? ? ? ? ? ??
? ? ? ? ? ? ? if(n==100) {k=0; }else{k=10 ; ?} ? ? ? ? ? ?
? ? ? ? ? ? ? ss=intToString (n)+"%" ;
? ? ? ? ? cs.SetColor (255,20,150,100);
? ? ? ? ? cs.SetTextSize (24); ? ?
? ? ? ? ? cs.DrawText (ss,330+k,309);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ? ? } ? //draw bar ?
? ? ? if (n<100){
? ? ? ? ?cs.SetColor(225,250,250,250); ?//clear
? ? ? ? ?cs.DrawCircle(px,py,90); ? ?}
?t=t+1; ? ? ? ?
if (t<5) goto replay; ? ? //replay 5 times
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (270,390,450,460) ;
? ? ?cs.SetColor (255,250,50,50);
? ? cs.SetTextSize (30); ? ?
? ? cs.DrawText (" 環(huán)形進(jìn)度條示例",255,500);
? ? ?cs.Update ();
}//bar6()

?

bar5(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ? ?
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ? ? cs.SetColor (255,120,120,120); ?
? ? for (i=0;i<202;i++){ ?//底色
? ? ? ? cs.SetColor (255,0,0,0); ?
? ? ? ? cs.DrawCircle (i*2+113,385,19); ? }
? ? ?for (i=0;i<202;i++){ ?//底色
? ? ? ?cs.SetColor (255,220,220,220); ?
? ? ? ? cs.DrawCircle (i*2+113,385,17); ? }
? ? ? ? ? ? cs.Update ();
? ? for (i=0;i<201;i++){ ?//進(jìn)度條 (5)?
? ? ? ? ?cs.SetColor (255,255-i/2 ,i+50,120);
? ? ? ? ?cs.DrawCircle (i*2+113,385,13); ?
? ? ? ? ?cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect(535,367,600,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,540,393);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,0,120,80);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 三色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar5 ()

?

bar4(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(1);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ??
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ? ? cs.SetFillMode (0);//0不填色,1填色
? ? ? ? cs.SetColor (255,50,50,50); ? ?//框線
? ? ? ? cs.DrawRect (93,363,512,407) ;
? ? ? ? cs.Update ();
?
? ? ?for (i=0;i<51;i++){ ?//進(jìn)度條 (4)?
? ? ?cs.SetFillMode (0);//0不填色,1填色
? ? ? ? cs.SetColor (255,20,200,10);
? ? ? ? ?cs.DrawRect (i*8+100,370,i*8+106,400); ?
? ? ? cs.SetFillMode (1);//0不填色,1填色
? ? ? ? cs.SetColor (255,250,0,20);
? ? ? ? ?cs.DrawRect (i*8+102,372,i*8+105,399); ?
? ? ? //sleep (10);
? ? ? ? ?cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect (515,367,588,403) ;
? ? ? ? ? ? ? n=(int)(i *2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,525,395);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,150,80,40);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 雙色條形進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar4()

?

bar3(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(1);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ??
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ? ? cs.SetFillMode (0);//0不填色,1填色
? ? ? ? cs.SetColor (255,50,50,50);
? ? ? ? cs.DrawRect (93,363,512,407) ;
? ? ? ? cs.Update ();
?
? ? ?for (i=0;i<51;i++){ ?//進(jìn)度條 (1)?
? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? cs.SetColor (255,20,0,200);
? ? ? ? ?cs.DrawRect (i*8+100,370,i*8+106,400); ?
? ? ? ? // sleep (10);
? ? ? cs.SetFillMode (1);//0不填色,1填色
? ? ? ? cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect (515,367,588,403) ;
? ? ? ? ? ? ? n=(int)(i *2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,525,395);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,150,80,40);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 單色條形進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar3()

?

bar2(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,250,250,250);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (30); ??
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ? ? cs.SetFillMode (0);//0不填色,1填色
? ? ? ? cs.SetColor (255,50,50,50);
? ? ? ? cs.DrawRect (93,365,508,405) ;
? ? ? ? cs.Update ();
?
? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ?for (i=0;i<201;i++){ ?//進(jìn)度條 (2)?
? ? ? ? cs.SetColor (255,255-i/2,200-i,i);
? ? ? ? ?cs.DrawLine (i*2+100,370,i*2+100,400); ?
? ? ? ? ?cs.SetColor (255,250,250,250); ?//clear
? ? ? ? ?cs.DrawRect (512,367,588,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,515,395);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ? cs.SetColor (255,250,250,250); ?//clear text
? ? ? ? cs.DrawRect (100,300,300,358) ;
? ? ?cs.SetColor (255,150,80,40);
? ? cs.SetTextSize (40); ? ?
? ? cs.DrawText (" 三色漸變進(jìn)度條示例",110,530);
? ? ?cs.Update ();
}//bar2 ()

?

bar1(){
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ? ? ? ? ?cs.SetStrokeWidth(2);
? ? ? ?cs.SetColor (255,50,50,50); ?//background
? ? ? ?cs.DrawRect (0,600,720,900);
? ? ? ?cs.SetColor (255,220,220,220);
? ? ? ? cs.DrawRect (0,4,720,600);
? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? cs.SetColor (255,20,20,140);
? ? ? ? cs.DrawText (" 繪制進(jìn)度條示例 ",20,35);
? ? ? ? s=intToString (sn);
? ? ? ? ss="mode = "+s ;
? ? ? ? cs.DrawText (ss,550,35);
? ? ? ? cs.DrawText ("Loading......" ,100,350);
? ? ?cs.SetFillMode (0);//0不填色,1填色
? ? ? ? cs.SetColor (255,50,50,50);
? ? ? ? cs.DrawRect (93,365,508,405) ;

?// ? cs.SetFillMode (1);//0不填色,1填色 ?
? ? ? ? ?cs.SetTextSize (48); ? ?
? ? ? ? ?cs.SetTextStyle(1); ? ?
? ss=" □□□□工資管理系統(tǒng) ”;
? ? ? ? ?cs.SetColor (255,50,250,50);
? ? ? ? ? cs.DrawText (ss,100,150);
? ? cs.SetFillMode (1);//0不填色,1填色
? ? ? ?cs.SetColor (255,20,50,200);
? ? ? ? ? cs.DrawText (ss,100,150);

? ? ? ? cs.SetTextSize (26); ? ?
? ? cs.SetColor (255,250,250,250); ?
? ? ? ? ?cs.DrawRect (255,215,575,258);
? ? ?cs.SetColor (255,150,50,150);
?cs.DrawText ("User Name : ?" ,110,250);
?cs.DrawText ("My Name " ,264,245);
? ? ?cs.SetColor (255,250,250,250); ?
? ? ? ? ?cs.DrawRect (255,265,575,308);
? ? ?cs.SetColor (255,150,50,150);
?cs.DrawText ("Password : ?" ,110,300);
?cs.DrawText ("********* ?" ,264,300);

? //draw button 繪制漸變色按鈕
? cs.SetColor (255,250,250,250); ?
? ? cs.DrawRect (130,428,301,491);
? ? cs.DrawRect (350,428,521,491);
? ? ? ?for (i=1;i<60;i++){ ? ?//按鈕漸變色
? cs.SetColor (255,250-i*4,240-i*3,200-i*3); ?
? ? ? cs.DrawLine (132,430+i,300,430+i); ?
? ? ? cs.DrawLine (352,430+i,520,430+i); ?
? ? ? ? ? } ? ?
? ? ?cs.SetColor(255,255,250,0);
? ? ? cs.SetTextStyle (0);
? ? ? cs.SetTextSize (32);
? ? ? cs.DrawText ("Log ?in",165,467);
? ? ? cs.DrawText (" ?Exit",387,467);
? ? ? ? cs.Update ();
? ? ? ?cs.SetFillMode (1);//0不填色,1填色
? ?for (i=0;i<201;i++){ ?//進(jìn)度條 (3)?
? ? ? ? ?cs.SetColor (150,255-i,i+10,i);
? ? ? ? ?cs.DrawLine (i*2+100,370,i*2+100,400); ?
? ? ? ? ?cs.SetColor (255,240,240,240); ?//clear
? ? ? ? ?cs.DrawRect (512,367,590,403) ;
? ? ? ? ? ? ? n=(int)(i /2) ;
? ? ? ? ? ? ? ss=intToString (n)+" %" ;
? ? ? ? ? cs.SetColor (255,250,20,20);
? ? ? ? ? cs.SetTextSize (26); ? ?
? ? ? ? ? cs.DrawText (ss,518,395);
? ? ? ? ? ? ?cs.Update (); ? ? //顯示繪出過程
? ? ? ? ? ? ?}
? ? ? ?cs.SetColor (255,220,220,220); ?//clear text
? ? ? ?cs.DrawRect (100,320,300,358) ;
? ? ?cs.SetColor (255,240,120,80);
? ? cs.SetTextSize (36); ? ?
? ? cs.DrawText (" 三色漸變進(jìn)度條示例",80,550);
? ? ?cs.Update ();
}//bar1 ()

?

myToolBarProc(int nBtn,int nContext){
? ? ? if(nBtn==100){//演示
? ? ? ? ? cs.SetBackground(245,245,245);
? ? ? ? ? setDisplay (1);
? ? ? ? ? show_pad ();
? ? ? ? ? ? ? ? ? ? ? ?} ?
? ? ? if(nBtn==101){//mode+
? ? ? ? ? ? sn=sn-1;
? ? ? ? ? ? if (sn<1)sn=1;
? ? ? ? ? ? show_pad ();
? ? ? ? ? ? }
? ? ? if(nBtn==102){//mode -
? ? ? ? ? ? sn=sn+1;
? ? ? ? ? ? if (sn>20)sn=20;
? ? ? ? ? ? show_pad ();
? ? ? ? ? ? ?}
? ? ? if(nBtn==103){//顯示圖板
? ? ? ? ? ?setDisplay (1);
? ? ? ? ?}

? ? ? if(nBtn==104){//退出程序
? ? ? ? ?clearOutput();
? ? ? ? ?cs.ClearDraw (0,src);
? ? ? ? ?setDisplay (0);
? ? ? ? ? exit (0);
? ? ? ? ?}
? ? ?if(nBtn==105){//?
? ? ? ? ? setDisplay (1);
? ? ? ? ? //cover (); ??
? ? ? ? ? }
}//myToolBar ()

?

//== End ==

總結(jié)

以上是生活随笔為你收集整理的C语言绘画示例-进度条的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。