IMAGE3.PRG
上传用户:abc1382430
上传日期:2013-01-31
资源大小:1233k
文件大小:3k
源码类别:

行业应用

开发平台:

VFP

  1. *********************************************************
  2. *
  3. * Name: Stuff
  4. *       此程序演示图像移动
  5. *
  6. **********************************************************
  7. set talk off
  8. set esca off
  9. set path to ..
  10. set curs off
  11. do LoadSDK                    && 装入SDK
  12. priv all like P_*
  13. P_Color='B/W,W+/B,W/W,W+/B,W/B,W+/B,GR/W,W/B,N/W,W+/W'
  14. =DefiWind("Demo",1,2,srows()-2,scols()-3,;
  15.     "colo &P_Color titl '基本图形特技演示'")
  16. =ActiWind("Demo")
  17. Demo_X1=C2X(1)
  18. Demo_Y1=R2Y(1)
  19. Demo_X2=C2X(wcol("Demo")-1)
  20. Demo_Y2=R2Y(wrow("Demo"))
  21. =DnRect(Demo_X1-1,Demo_Y1-1,Demo_X2+1,Demo_Y2+1)
  22. =AutoSize(.f.)
  23. do Image3_1
  24. =ReleWind('Demo')
  25. retu
  26. *-------------------------------------------------------------------------
  27. Func UpImg
  28. para M_X1,M_Y1,M_X2,M_Y2,M_Step
  29. priv P_Img
  30. P_Img=GetImage(M_X1,M_Y1,M_X2,M_Y1+M_Step)
  31. =MoveImage(M_X1,M_Y1+1+M_Step,M_X2,M_Y2,M_X1,M_Y1)
  32. =PutImage(M_X1,M_Y2-M_Step,P_Img)
  33. =ReleImage(P_Img)
  34. retu
  35. *-------------------------------------------------------------------------
  36. Func DnImg
  37. para M_X1,M_Y1,M_X2,M_Y2,M_Step
  38. priv P_Img
  39. P_Img=GetImage(M_X1,M_Y2-M_Step,M_X2,M_Y2)
  40. =MoveImage(M_X1,M_Y1,M_X2,M_Y2-1-M_Step,M_X1,M_Y1+1+M_Step)
  41. =PutImage(M_X1,M_Y1,P_Img)
  42. =ReleImage(P_Img)
  43. retu
  44. *-------------------------------------------------------------------------
  45. Func LeftImg
  46. para M_X1,M_Y1,M_X2,M_Y2,M_Step
  47. priv P_Img
  48. P_Img=GetImage(M_X1,M_Y1,M_X1+M_Step,M_Y2)
  49. =MoveImage(M_X1+1+M_Step,M_Y1,M_X2,M_Y2,M_X1,M_Y1)
  50. =PutImage(M_X2-M_Step,M_Y1,P_Img)
  51. =ReleImage(P_Img)
  52. retu
  53. *-------------------------------------------------------------------------
  54. Func RightImg
  55. para M_X1,M_Y1,M_X2,M_Y2,M_Step
  56. priv P_Img
  57. P_Img=GetImage(M_X2-M_Step,M_Y1,M_X2,M_Y2)
  58. =MoveImage(M_X1,M_Y1,M_X2-1-M_Step,M_Y2,M_X1+1+M_Step,M_Y1)
  59. =PutImage(M_X1,M_Y1,P_Img)
  60. =ReleImage(P_Img)
  61. retu
  62. *-------------------------------------------------------------------------
  63. Func Image3_1
  64. priv all like P_*
  65. =ShowBmpin(Demo_X1,Demo_Y1,Demo_X2,Demo_Y2,"9516.bmp")
  66. =SetPutMode(_OR)
  67. =ShowBmpin(Demo_X1,Demo_Y1,Demo_X2,Demo_Y2,"novell.bmp")
  68. =SetPutMode(_COPY)
  69. if inke(3)=27
  70. retu
  71. endi
  72. =SetPutMode(_COPY)
  73. P_X1=Demo_X1+(Demo_X2-Demo_X1+1)/2-160
  74. P_Y1=Demo_Y1+(Demo_Y2-Demo_Y1+1)/2-120
  75. P_X2=P_X1+320-1
  76. P_Y2=P_Y1+240-1
  77. =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
  78. =SetHZFont(0)
  79. =SetHZStyle(_SHADOW+_OUTLINE)
  80. =SetHZSize(96,142,0)
  81. =SetHZPutMode(_OR)
  82. =SetHZShadow(4,3,0)
  83. =SetHZColor(11)
  84. =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
  85. P_Step=0
  86. for P_I=1 to 240 Step 1
  87. =UpImg(P_X1,P_Y1,P_X2,P_Y2,P_Step)
  88. if inke()#0
  89. exit
  90. endi
  91. endf
  92. if last()=27
  93. retu
  94. endi
  95. =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
  96. =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
  97. for P_I=1 to 120  Step 1
  98. =DnImg(P_X1,P_Y1,P_X2,P_Y1+119,P_Step)
  99. =UpImg(P_X1,P_Y1+120,P_X2,P_Y2,P_Step)
  100. if inke()#0
  101. exit
  102. endi
  103. endf
  104. if last()=27
  105. retu
  106. endi
  107. =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
  108. =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
  109. P_Step=1
  110. for P_I=1 to 320 step 2
  111. =LeftImg(P_X1,P_Y1,P_X2,P_Y2,P_Step)
  112. if inke()#0
  113. exit
  114. endi
  115. endf
  116. =ShowBmp(P_X1,P_Y1,"winlogo.bmp")
  117. =ShowHZ(P_X1+40,P_Y1+50,"UCSDK")
  118. for P_I=1 to 160 step 2
  119. =RightImg(P_X1,P_Y1,P_X1+159,P_Y2,P_Step)
  120. =LeftImg(P_X1+160,P_Y1,P_X2,P_Y2,P_Step)
  121. if inke()#0
  122. exit
  123. endi
  124. endf
  125. retu