ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.PluginFramework/Core/ProcContainer.cs
(Generate patch)

Comparing trunk/RomCheater.PluginFramework/Core/ProcContainer.cs (file contents):
Revision 108 by william, Thu May 10 11:16:03 2012 UTC vs.
Revision 109 by william, Thu May 10 12:12:26 2012 UTC

# Line 70 | Line 70 | namespace RomCheater.PluginFramework.Cor
70              if (proc == null) return null;
71              Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true);
72              if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false);
73 <            Bitmap ret = large.ToBitmap();
73 >            Bitmap ret = null;
74 >            if (large != null)
75 >                ret = large.ToBitmap();
76              if (ret == null)
77              {
78 <                int i = 0;
78 >                return null;
79              }
80              return ret;
81          }
# Line 82 | Line 84 | namespace RomCheater.PluginFramework.Cor
84              if (proc == null) return null;
85              Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true);
86              if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false);
87 <            Bitmap ret = large.ToBitmap();
87 >            Bitmap ret = null;
88 >            if (large != null)
89 >                ret = large.ToBitmap();
90              if (ret == null)
91              {
92 <                int i = 0;
92 >                return null;
93              }
94              ret = new Bitmap(ret, ret.Width * Scale, ret.Height * Scale);
95              return ret;
# Line 95 | Line 99 | namespace RomCheater.PluginFramework.Cor
99              if (proc == null) return null;
100              Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true);
101              if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false);
102 <            Bitmap ret = large.ToBitmap();
102 >            Bitmap ret = null;
103 >            if (large != null)
104 >                ret = large.ToBitmap();
105              if (ret == null)
106              {
107 <                int i = 0;
107 >                return null;
108              }
109              ret = new Bitmap(ret, Width, Height);
110              return ret;
# Line 108 | Line 114 | namespace RomCheater.PluginFramework.Cor
114              if (this.ProcessInfo == null) return;
115              Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true);
116              if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false);
117 <            Bitmap ret = large.ToBitmap();
117 >            Bitmap ret = null;
118 >            if (large != null)
119 >                ret = large.ToBitmap();
120              if (ret == null)
121              {
122 <                int i = 0;
122 >                this.ProcessIcon = null;
123 >                return;
124              }
125              this.ProcessIcon = ret;
126          }
127          private void CreateProcessIcon(int Scale)
128          {
129 +            if (this.ProcessInfo == null) return;
130              Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true);
131              if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false);
132 <            Bitmap ret = large.ToBitmap();
132 >            Bitmap ret = null;
133 >            if (large != null)
134 >                ret = large.ToBitmap();
135              if (ret == null)
136              {
137 <                int i = 0;
138 <            }
139 <            ret = new Bitmap(ret, ret.Width * Scale, ret.Height * Scale);          
137 >                this.ProcessIcon = null;
138 >                return;
139 >            }
140 >            ////Bitmap bmp = large.ToBitmap();
141 >            //string save_path = @"c:\temp";
142 >            //string icon_file = string.Format(@"{0}\{1}.bmp", save_path, new FileInfo(this.FileName).Name);
143 >          
144 >
145 >            ret = new Bitmap(ret, ret.Width * Scale, ret.Height * Scale);
146 >            //ret.Save(icon_file, System.Drawing.Imaging.ImageFormat.Bmp);
147              this.ProcessIcon = ret;
148          }
149          private void CreateProcessIcon(int Width, int Height)
# Line 132 | Line 151 | namespace RomCheater.PluginFramework.Cor
151              if (this.ProcessInfo == null) return;
152              Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true);
153              if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false);
154 <            Bitmap ret = large.ToBitmap();
154 >            Bitmap ret = null;
155 >            if (large != null)
156 >                ret = large.ToBitmap();
157              if (ret == null)
158              {
159 <                int i = 0;
159 >                this.ProcessIcon = null;
160 >                return;
161              }
162              ret = new Bitmap(ret, Width, Height);    
163              this.ProcessIcon = ret;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines