IMAGE3.PRG
上传用户:abc1382430
上传日期:2013-01-31
资源大小:1233k
文件大小:3k
- *********************************************************
- *
- * Name: Stuff
- * 此程序演示图像移动
- *
- **********************************************************
- set talk off
- set esca off
- set path to ..
- set curs off
- do LoadSDK && 装入SDK
- priv all like P_*
- P_Color='B/W,W+/B,W/W,W+/B,W/B,W+/B,GR/W,W/B,N/W,W+/W'
- =DefiWind("Demo",1,2,srows()-2,scols()-3,;
- "colo &P_Color titl '基本图形特技演示'")
- =ActiWind("Demo")
- Demo_X1=C2X(1)
- Demo_Y1=R2Y(1)
- Demo_X2=C2X(wcol("Demo")-1)
- Demo_Y2=R2Y(wrow("Demo"))
- =DnRect(Demo_X1-1,Demo_Y1-1,Demo_X2+1,Demo_Y2+1)
- =AutoSize(.f.)
- do Image3_1
- =ReleWind('Demo')
- retu
- *-------------------------------------------------------------------------
- Func UpImg
- para M_X1,M_Y1,M_X2,M_Y2,M_Step
- priv P_Img
- P_Img=GetImage(M_X1,M_Y1,M_X2,M_Y1+M_Step)
- =MoveImage(M_X1,M_Y1+1+M_Step,M_X2,M_Y2,M_X1,M_Y1)
- =PutImage(M_X1,M_Y2-M_Step,P_Img)
- =ReleImage(P_Img)
- retu
- *-------------------------------------------------------------------------
- Func DnImg
- para M_X1,M_Y1,M_X2,M_Y2,M_Step
- priv P_Img
- P_Img=GetImage(M_X1,M_Y2-M_Step,M_X2,M_Y2)
- =MoveImage(M_X1,M_Y1,M_X2,M_Y2-1-M_Step,M_X1,M_Y1+1+M_Step)
- =PutImage(M_X1,M_Y1,P_Img)
- =ReleImage(P_Img)
- retu
- *-------------------------------------------------------------------------
- Func LeftImg
- para M_X1,M_Y1,M_X2,M_Y2,M_Step
- priv P_Img
- P_Img=GetImage(M_X1,M_Y1,M_X1+M_Step,M_Y2)
- =MoveImage(M_X1+1+M_Step,M_Y1,M_X2,M_Y2,M_X1,M_Y1)
- =PutImage(M_X2-M_Step,M_Y1,P_Img)
- =ReleImage(P_Img)
- retu
- *-------------------------------------------------------------------------
- Func RightImg
- para M_X1,M_Y1,M_X2,M_Y2,M_Step
- priv P_Img
- P_Img=GetImage(M_X2-M_Step,M_Y1,M_X2,M_Y2)
- =MoveImage(M_X1,M_Y1,M_X2-1-M_Step,M_Y2,M_X1+1+M_Step,M_Y1)
- =PutImage(M_X1,M_Y1,P_Img)
- =ReleImage(P_Img)
- retu
- *-------------------------------------------------------------------------
- Func Image3_1
- priv all like P_*
- =ShowBmpin(Demo_X1,Demo_Y1,Demo_X2,Demo_Y2,"9516.bmp")
- =SetPutMode(_OR)
- =ShowBmpin(Demo_X1,Demo_Y1,Demo_X2,Demo_Y2,"novell.bmp")
- =SetPutMode(_COPY)
- if inke(3)=27
- retu
- endi
- =SetPutMode(_COPY)
- P_X1=Demo_X1+(Demo_X2-Demo_X1+1)/2-160
- P_Y1=Demo_Y1+(Demo_Y2-Demo_Y1+1)/2-120
- P_X2=P_X1+320-1
- P_Y2=P_Y1+240-1
- =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
- =SetHZFont(0)
- =SetHZStyle(_SHADOW+_OUTLINE)
- =SetHZSize(96,142,0)
- =SetHZPutMode(_OR)
- =SetHZShadow(4,3,0)
- =SetHZColor(11)
- =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
- P_Step=0
- for P_I=1 to 240 Step 1
- =UpImg(P_X1,P_Y1,P_X2,P_Y2,P_Step)
- if inke()#0
- exit
- endi
- endf
- if last()=27
- retu
- endi
- =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
- =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
- for P_I=1 to 120 Step 1
- =DnImg(P_X1,P_Y1,P_X2,P_Y1+119,P_Step)
- =UpImg(P_X1,P_Y1+120,P_X2,P_Y2,P_Step)
- if inke()#0
- exit
- endi
- endf
- if last()=27
- retu
- endi
- =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
- =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
- P_Step=1
- for P_I=1 to 320 step 2
- =LeftImg(P_X1,P_Y1,P_X2,P_Y2,P_Step)
- if inke()#0
- exit
- endi
- endf
- =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
- =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
- for P_I=1 to 160 step 2
- =RightImg(P_X1,P_Y1,P_X1+159,P_Y2,P_Step)
- =LeftImg(P_X1+160,P_Y1,P_X2,P_Y2,P_Step)
- if inke()#0
- exit
- endi
- endf
- retu