70 |
if (proc == null) return null; |
if (proc == null) return null; |
71 |
Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true); |
Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true); |
72 |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false); |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false); |
73 |
Bitmap ret = large.ToBitmap(); |
Bitmap ret = null; |
74 |
|
if (large != null) |
75 |
|
ret = large.ToBitmap(); |
76 |
if (ret == null) |
if (ret == null) |
77 |
{ |
{ |
78 |
int i = 0; |
return null; |
79 |
} |
} |
80 |
return ret; |
return ret; |
81 |
} |
} |
84 |
if (proc == null) return null; |
if (proc == null) return null; |
85 |
Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true); |
Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true); |
86 |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false); |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false); |
87 |
Bitmap ret = large.ToBitmap(); |
Bitmap ret = null; |
88 |
|
if (large != null) |
89 |
|
ret = large.ToBitmap(); |
90 |
if (ret == null) |
if (ret == null) |
91 |
{ |
{ |
92 |
int i = 0; |
return null; |
93 |
} |
} |
94 |
ret = new Bitmap(ret, ret.Width * Scale, ret.Height * Scale); |
ret = new Bitmap(ret, ret.Width * Scale, ret.Height * Scale); |
95 |
return ret; |
return ret; |
99 |
if (proc == null) return null; |
if (proc == null) return null; |
100 |
Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true); |
Icon large = ProcessIconEx.ExtractIConFromFile(proc.FileName, true); |
101 |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false); |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(proc.FileName, false); |
102 |
Bitmap ret = large.ToBitmap(); |
Bitmap ret = null; |
103 |
|
if (large != null) |
104 |
|
ret = large.ToBitmap(); |
105 |
if (ret == null) |
if (ret == null) |
106 |
{ |
{ |
107 |
int i = 0; |
return null; |
108 |
} |
} |
109 |
ret = new Bitmap(ret, Width, Height); |
ret = new Bitmap(ret, Width, Height); |
110 |
return ret; |
return ret; |
114 |
if (this.ProcessInfo == null) return; |
if (this.ProcessInfo == null) return; |
115 |
Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true); |
Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true); |
116 |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false); |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false); |
117 |
Bitmap ret = large.ToBitmap(); |
Bitmap ret = null; |
118 |
|
if (large != null) |
119 |
|
ret = large.ToBitmap(); |
120 |
if (ret == null) |
if (ret == null) |
121 |
{ |
{ |
122 |
int i = 0; |
this.ProcessIcon = null; |
123 |
|
return; |
124 |
} |
} |
125 |
this.ProcessIcon = ret; |
this.ProcessIcon = ret; |
126 |
} |
} |
127 |
private void CreateProcessIcon(int Scale) |
private void CreateProcessIcon(int Scale) |
128 |
{ |
{ |
129 |
|
if (this.ProcessInfo == null) return; |
130 |
Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true); |
Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true); |
131 |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false); |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false); |
132 |
Bitmap ret = large.ToBitmap(); |
Bitmap ret = null; |
133 |
|
if (large != null) |
134 |
|
ret = large.ToBitmap(); |
135 |
if (ret == null) |
if (ret == null) |
136 |
{ |
{ |
137 |
int i = 0; |
this.ProcessIcon = null; |
138 |
} |
return; |
139 |
ret = new Bitmap(ret, ret.Width * Scale, ret.Height * Scale); |
} |
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; |
this.ProcessIcon = ret; |
148 |
} |
} |
149 |
private void CreateProcessIcon(int Width, int Height) |
private void CreateProcessIcon(int Width, int Height) |
151 |
if (this.ProcessInfo == null) return; |
if (this.ProcessInfo == null) return; |
152 |
Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true); |
Icon large = ProcessIconEx.ExtractIConFromFile(this.FileName, true); |
153 |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false); |
if (large == null) large = ProcessIconEx.ExtractIConFromFile(this.FileName, false); |
154 |
Bitmap ret = large.ToBitmap(); |
Bitmap ret = null; |
155 |
|
if (large != null) |
156 |
|
ret = large.ToBitmap(); |
157 |
if (ret == null) |
if (ret == null) |
158 |
{ |
{ |
159 |
int i = 0; |
this.ProcessIcon = null; |
160 |
|
return; |
161 |
} |
} |
162 |
ret = new Bitmap(ret, Width, Height); |
ret = new Bitmap(ret, Width, Height); |
163 |
this.ProcessIcon = ret; |
this.ProcessIcon = ret; |