MediaFile.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using DocumentFormat.OpenXml.Packaging;
  8. using DocumentFormat.OpenXml;
  9. namespace ConsoleApplication
  10. {
  11. class MediaFile
  12. {
  13. private int _offX, _offY, _extX, _extY, _rotation, _alpha;
  14. private string _imageType, _imageLocation, _storeLocation, _imageName;
  15. private ImagePart _imagePart;
  16. public MediaFile()
  17. {
  18. _extX = 0;
  19. _extY = 0;
  20. _offX = 0;
  21. _offY = 0;
  22. _alpha = 100000;
  23. _rotation = 0;
  24. _imageType = "";
  25. _imagePart = null;
  26. _storeLocation = @"C:\Users\ex1\Desktop\PPTImages\";
  27. }
  28. public string ImageName
  29. {
  30. get { return _imageName; }
  31. set
  32. {
  33. _imageName = value;
  34. ImageType = _imageName.Split('.')[1];
  35. }
  36. }
  37. public string StoreLocation
  38. {
  39. get { return _storeLocation; }
  40. set { _storeLocation = value; }
  41. }
  42. public string ImageLocation
  43. {
  44. get { return _imageLocation; }
  45. set { _imageLocation = value; }
  46. }
  47. public string ImageType
  48. {
  49. get { return _imageType; }
  50. set { _imageType = value; }
  51. }
  52. public int Alpha
  53. {
  54. get { return _alpha; }
  55. set { _alpha = value; }
  56. }
  57. public int Rotation
  58. {
  59. get { return _rotation; }
  60. set { _rotation = value; }
  61. }
  62. public int ExtY
  63. {
  64. get { return _extY; }
  65. set { _extY = value; }
  66. }
  67. public int ExtX
  68. {
  69. get { return _extX; }
  70. set { _extX = value; }
  71. }
  72. public int OffY
  73. {
  74. get { return _offY; }
  75. set { _offY = value; }
  76. }
  77. public int OffX
  78. {
  79. get { return _offX; }
  80. set { _offX = value; }
  81. }
  82. public ImagePart ImagePart
  83. {
  84. get { return _imagePart; }
  85. set { _imagePart = value; }
  86. }
  87. public string toString()
  88. {
  89. return "Image information \n" +
  90. " Image Name: " + _imageName + "\n" +
  91. " Offset Position (X,Y): (" + _offX + "," + _offY + ")\n" +
  92. " Extent Position (X,Y): (" + _extX + "," + _extY + ")\n" +
  93. " Rotation: " + _rotation + "\n" +
  94. " Image Type: " + _imageType + "\n" +
  95. " Alpha: " + _alpha + "\n";
  96. }
  97. }
  98. }