Sprite.Property.11.Image.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. using System.Drawing;
  2. namespace Microsoft.Windows.Forms
  3. {
  4. public partial class Sprite
  5. {
  6. private Image m_Image = null;
  7. /// <summary>
  8. /// 正常状态下图片
  9. /// </summary>
  10. public Image Image
  11. {
  12. get
  13. {
  14. return this.m_Image;
  15. }
  16. set
  17. {
  18. if (value != this.m_Image)
  19. {
  20. this.m_Image = value;
  21. this.Feedback();
  22. }
  23. }
  24. }
  25. private Image m_ImageHovered = null;
  26. /// <summary>
  27. /// 鼠标移上图片
  28. /// </summary>
  29. public Image ImageHovered
  30. {
  31. get
  32. {
  33. return this.m_ImageHovered;
  34. }
  35. set
  36. {
  37. if (value != this.m_ImageHovered)
  38. {
  39. this.m_ImageHovered = value;
  40. this.Feedback();
  41. }
  42. }
  43. }
  44. private Image m_ImagePressed = null;
  45. /// <summary>
  46. /// 鼠标按下图片
  47. /// </summary>
  48. public Image ImagePressed
  49. {
  50. get
  51. {
  52. return this.m_ImagePressed;
  53. }
  54. set
  55. {
  56. if (value != this.m_ImagePressed)
  57. {
  58. this.m_ImagePressed = value;
  59. this.Feedback();
  60. }
  61. }
  62. }
  63. private Image m_ImageFocused = null;
  64. /// <summary>
  65. /// 拥有焦点图片
  66. /// </summary>
  67. public Image ImageFocused
  68. {
  69. get
  70. {
  71. return this.m_ImageFocused;
  72. }
  73. set
  74. {
  75. if (value != this.m_ImageFocused)
  76. {
  77. this.m_ImageFocused = value;
  78. this.Feedback();
  79. }
  80. }
  81. }
  82. private Image m_ImageDisabled = null;
  83. /// <summary>
  84. /// 状态禁用图片
  85. /// </summary>
  86. public Image ImageDisabled
  87. {
  88. get
  89. {
  90. return this.m_ImageDisabled;
  91. }
  92. set
  93. {
  94. if (value != this.m_ImageDisabled)
  95. {
  96. this.m_ImageDisabled = value;
  97. this.Feedback();
  98. }
  99. }
  100. }
  101. private Image m_ImageHighlight = null;
  102. /// <summary>
  103. /// 高亮图片
  104. /// </summary>
  105. public Image ImageHighlight
  106. {
  107. get
  108. {
  109. return this.m_ImageHighlight;
  110. }
  111. set
  112. {
  113. if (value != this.m_ImageHighlight)
  114. {
  115. this.m_ImageHighlight = value;
  116. this.Feedback();
  117. }
  118. }
  119. }
  120. private Point m_ImageOffset = Point.Empty;
  121. /// <summary>
  122. /// 图片偏移
  123. /// </summary>
  124. public Point ImageOffset
  125. {
  126. get
  127. {
  128. return this.m_ImageOffset;
  129. }
  130. set
  131. {
  132. if (value != this.m_ImageOffset)
  133. {
  134. this.m_ImageOffset = value;
  135. this.Feedback();
  136. }
  137. }
  138. }
  139. private Point m_ImageOffsetHovered = Point.Empty;
  140. /// <summary>
  141. /// 鼠标移上时在ImageOffset上再次偏移
  142. /// </summary>
  143. public Point ImageOffsetHovered
  144. {
  145. get
  146. {
  147. return this.m_ImageOffsetHovered;
  148. }
  149. set
  150. {
  151. if (value != this.m_ImageOffsetHovered)
  152. {
  153. this.m_ImageOffsetHovered = value;
  154. this.Feedback();
  155. }
  156. }
  157. }
  158. private Point m_ImageOffsetPressed = Point.Empty;
  159. /// <summary>
  160. /// 鼠标按下时在ImageOffset上再次偏移
  161. /// </summary>
  162. public Point ImageOffsetPressed
  163. {
  164. get
  165. {
  166. return this.m_ImageOffsetPressed;
  167. }
  168. set
  169. {
  170. if (value != this.m_ImageOffsetPressed)
  171. {
  172. this.m_ImageOffsetPressed = value;
  173. this.Feedback();
  174. }
  175. }
  176. }
  177. private Point m_ImageOffsetFocused = Point.Empty;
  178. /// <summary>
  179. /// 获取焦点时在ImageOffset上再次偏移
  180. /// </summary>
  181. public Point ImageOffsetFocused
  182. {
  183. get
  184. {
  185. return this.m_ImageOffsetFocused;
  186. }
  187. set
  188. {
  189. if (value != this.m_ImageOffsetFocused)
  190. {
  191. this.m_ImageOffsetFocused = value;
  192. this.Feedback();
  193. }
  194. }
  195. }
  196. private Point m_ImageOffsetDisabled = Point.Empty;
  197. /// <summary>
  198. /// 禁用时在ImageOffset上再次偏移
  199. /// </summary>
  200. public Point ImageOffsetDisabled
  201. {
  202. get
  203. {
  204. return this.m_ImageOffsetDisabled;
  205. }
  206. set
  207. {
  208. if (value != this.m_ImageOffsetDisabled)
  209. {
  210. this.m_ImageOffsetDisabled = value;
  211. this.Feedback();
  212. }
  213. }
  214. }
  215. private Point m_ImageOffsetHighlight = Point.Empty;
  216. /// <summary>
  217. /// 高亮时在ImageOffset上再次偏移
  218. /// </summary>
  219. public Point ImageOffsetHighlight
  220. {
  221. get
  222. {
  223. return this.m_ImageOffsetHighlight;
  224. }
  225. set
  226. {
  227. if (value != this.m_ImageOffsetHighlight)
  228. {
  229. this.m_ImageOffsetHighlight = value;
  230. this.Feedback();
  231. }
  232. }
  233. }
  234. private Size m_ImageSize = new Size(32, 32);
  235. /// <summary>
  236. /// 图片大小
  237. /// </summary>
  238. public Size ImageSize
  239. {
  240. get
  241. {
  242. return this.m_ImageSize;
  243. }
  244. set
  245. {
  246. if (value != this.m_ImageSize)
  247. {
  248. this.m_ImageSize = value;
  249. this.Feedback();
  250. }
  251. }
  252. }
  253. private ContentAlignment m_ImageAlign = ContentAlignment.MiddleCenter;
  254. /// <summary>
  255. /// 图片对齐方式
  256. /// </summary>
  257. public ContentAlignment ImageAlign
  258. {
  259. get
  260. {
  261. return this.m_ImageAlign;
  262. }
  263. set
  264. {
  265. if (value != this.m_ImageAlign)
  266. {
  267. this.m_ImageAlign = value;
  268. this.Feedback();
  269. }
  270. }
  271. }
  272. private float m_ImageRotateAngle = 0f;
  273. /// <summary>
  274. /// 图片旋转角度
  275. /// </summary>
  276. public float ImageRotateAngle
  277. {
  278. get
  279. {
  280. return this.m_ImageRotateAngle;
  281. }
  282. set
  283. {
  284. if (value != this.m_ImageRotateAngle)
  285. {
  286. this.m_ImageRotateAngle = value;
  287. this.Feedback();
  288. }
  289. }
  290. }
  291. private bool m_ImageGrayOnDisabled = true;
  292. /// <summary>
  293. /// 图片状态禁用是否变灰
  294. /// </summary>
  295. public bool ImageGrayOnDisabled
  296. {
  297. get
  298. {
  299. return this.m_ImageGrayOnDisabled;
  300. }
  301. set
  302. {
  303. if (value != this.m_ImageGrayOnDisabled)
  304. {
  305. this.m_ImageGrayOnDisabled = value;
  306. this.Feedback();
  307. }
  308. }
  309. }
  310. }
  311. }