CHoleBSEImg.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. 
  2. using OTSCLRINTERFACE;
  3. using System.Drawing;
  4. namespace OTSDataType
  5. {
  6. public class CHoleBSEImg : CBSEImgClr
  7. {
  8. protected System.Drawing.Point m_poiPosition = new System.Drawing.Point();
  9. public CHoleBSEImg()
  10. {
  11. Init();
  12. }
  13. public CHoleBSEImg(Rectangle a_rectImage, System.Drawing.Point a_poiPosition) // constructor
  14. {
  15. Init();
  16. // set image rectangle and create memory for image data
  17. SetImageRect(a_rectImage);
  18. //m_nHoleID = a_nHoleID;
  19. m_poiPosition = a_poiPosition;
  20. }
  21. public CHoleBSEImg(CHoleBSEImg a_oSource)
  22. {
  23. if (a_oSource == null)
  24. {
  25. return;
  26. }
  27. // can't copy itself
  28. if (a_oSource == this)
  29. {
  30. return;
  31. }
  32. // copy data over
  33. Duplicate(a_oSource);
  34. }
  35. public bool Equals(CHoleBSEImg a_oSource)
  36. {
  37. if(m_poiPosition!= a_oSource.m_poiPosition)
  38. {
  39. return false;
  40. }
  41. return true;
  42. }
  43. // position
  44. public System.Drawing.Point GetPosition()
  45. {
  46. return m_poiPosition;
  47. }
  48. public void SetPosition(System.Drawing.Point a_poiPosition)
  49. {
  50. m_poiPosition = a_poiPosition;
  51. }
  52. // Initialization
  53. protected void Init()
  54. {
  55. m_poiPosition = new System.Drawing.Point(0, 0);
  56. }
  57. // duplication
  58. protected void Duplicate(CHoleBSEImg a_oSource)
  59. {
  60. m_poiPosition = a_oSource.m_poiPosition;
  61. }
  62. }
  63. }