(path: string)
| 142 | return uiImage ? new ImageSource(uiImage) : null; |
| 143 | } |
| 144 | static fromFile(path: string): Promise<ImageSource> { |
| 145 | return new Promise<ImageSource>((resolve, reject) => { |
| 146 | try { |
| 147 | UIImage.tns_decodeImageWidthContentsOfFileCompletion(getFileName(path), (uiImage) => { |
| 148 | if (uiImage) { |
| 149 | resolve(new ImageSource(uiImage)); |
| 150 | } |
| 151 | }); |
| 152 | } catch (ex) { |
| 153 | reject(ex); |
| 154 | } |
| 155 | }); |
| 156 | } |
| 157 | |
| 158 | static fromFileOrResourceSync(path: string): ImageSource { |
| 159 | if (!isFileOrResourcePath(path)) { |
nothing calls this directly
no test coverage detected