| 1154 | } |
| 1155 | |
| 1156 | void CtrlrPanelCanvas::importImage (const File &imageFile, int x, int y) |
| 1157 | { |
| 1158 | if (owner.getOwner().getResourceManager().addResource (imageFile)) |
| 1159 | { |
| 1160 | AlertWindow::showMessageBox(AlertWindow::InfoIcon, "Image import", "Can't import the file as a image resource"); |
| 1161 | return; |
| 1162 | } |
| 1163 | |
| 1164 | Image i = owner.getOwner().getResourceManager().getResourceAsImage(imageFile.getFileNameWithoutExtension()); |
| 1165 | |
| 1166 | if (i == Image()) |
| 1167 | { |
| 1168 | AlertWindow::showMessageBox(AlertWindow::InfoIcon, "Image import", "Image has been imported as a resource, but i can't fetch if from the resource manager"); |
| 1169 | return; |
| 1170 | } |
| 1171 | |
| 1172 | CtrlrComponent *c = addNewComponent(Ids::uiImage, Point<int>(x,y)); |
| 1173 | if (c) |
| 1174 | { |
| 1175 | c->setProperty(Ids::uiImageResource, imageFile.getFileNameWithoutExtension()); |
| 1176 | c->setSize (i.getWidth(), i.getHeight()); |
| 1177 | } |
| 1178 | } |
| 1179 | |
| 1180 | void CtrlrPanelCanvas::fitSelection() |
| 1181 | { |
nothing calls this directly
no test coverage detected