Ignore:
Timestamp:
Nov 15, 2004, 2:12:03 AM (19 years ago)
Author:
altba\tomoyo
Message:

MacFaceFloat?

  • %USERPROFILE%\Application Data\MacFace\ に設定を保存するようにした。
  • 設定ダイアログを作成した。

MacFaceLibrary?

  • パターンをクラスとして扱えるようにした(FacePattern?)。
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MacFaceLibrary/Part.cs

    r8 r13  
    1212        /// Part ‚ÌŠT—v‚Ìà–¾‚Å‚·B
    1313        /// </summary>
    14         public class Part
     14        public class Part : IDisposable
    1515        {
    16                 protected Image image;
    17                 protected string filename;
    18                 protected int x;
    19                 protected int y;
     16                private Image _image;
     17                private string _filename;
     18                private Point _point;
    2019
    2120                /*public Part(string basePath, Hashtable partDef)
     
    2827                public Part(String path, int x, int y)
    2928                {
    30                         this.filename = filename;
    31                         this.image = Image.FromFile(path);
    32                         this.x = x;
    33                         this.y = y;
     29                        _filename = System.IO.Path.GetFileName(path);
     30                        _image = Image.FromFile(path);
     31                        this.X = x;
     32                        this.Y = y;
    3433                }
    3534
    3635                public Part(String path, Image image, int x, int y)
    3736                {
    38                         this.filename = filename;
    39                         this.image = image;
    40                         this.x = x;
    41                         this.y = y;
     37                        _filename = System.IO.Path.GetFileName(path);
     38                        _image = image;
     39                        this.X = x;
     40                        this.Y = y;
    4241                }
    4342
    4443                public string FileName
    4544                {
    46                         get { return filename; }
     45                        get { return _filename; }
    4746                }
    4847
    4948                public Image Image
    5049                {
    51                         get { return image; }
     50                        get { return _image; }
    5251                }
    5352
     53                public Point Point
     54                {
     55                        get { return _point; }
     56                        set { _point = value; }
     57                }
    5458                public int X
    5559                {
    56                         get { return x; }
     60                        get { return _point.X; }
     61                        set { _point.X = value; }
    5762                }
    5863
    5964                public int Y
    6065                {
    61                         get { return y; }
     66                        get { return 128 - _point.Y - _image.Height; }
     67                        set { _point.Y = 128 - value - _image.Height; }
    6268                }
    6369
     
    6773                        g.DrawImage(img, x, drawY, img.Size.Width, img.Size.Height);
    6874                }*/
     75
     76                #region IDisposable ƒƒ“ƒo
     77
     78                public void Dispose()
     79                {
     80                        Dispose(true);
     81                        GC.SuppressFinalize(this);
     82                }
     83
     84                protected virtual void Dispose(bool disposing)
     85                {
     86                        if (disposing)
     87                        {
     88                        }
     89                        // íœ
     90                        if (_image != null) { _image.Dispose(); }
     91                }
     92
     93                ~Part()
     94                {
     95                        Dispose(false);
     96                }
     97
     98                #endregion
    6999        }
    70100}
Note: See TracChangeset for help on using the changeset viewer.