In cxGrid i have a column which is "Image" type.(properties=Image,GraphicClassName=TJpegImage). To the PopUpMenuLayout - MenuItems I have added a CustomMenuItem called "Open With...". How can I implement this custom menu item so that it opens my underlying image with Paint (windows Paint)? Or at least trigger the "Open with.." windows dialog.
-
Re "Open with" see http://stackoverflow.com/questions/9224693/how-can-i-display-the-open-with-dialog-for-an-unregistered-file-extension. – Uli Gerhardt Jun 03 '14 at 08:40
-
1This question seems to be completely unrelated to TcxGrid/DevEx. Or did I miss something? – Uli Gerhardt Jun 03 '14 at 12:04
1 Answers
If you have your image stored in a database then you will first have to save it into image file on your computer.
Then you can then simply use ShellExecute for opening this image with default image viewing/editing program. ShellExecute works basically the same as if user would have double-clicked on your file. The problem is that usually doublec-licking on image file opens a preview of it so if you need to edit that image using of ShellExecute might not be the best way.
Now in order to be sure that the image is opened for editing rathen than just in preview you would have to read windows registry to get information about which program is used for viewing and editing of that specific image format and then use CreateProcess API cal instead.
You could also make sure that image is opened with specific program by starting that program using CreateProcess API call and passing image location as startup parameter (most image editing programs treat first parameter as file to open upon startup

- 7,372
- 2
- 16
- 22
-
I am trying to avoid saving to disk. I thought of opening it directly - from cxGrid to default image editor. – user763539 Jun 04 '14 at 09:23
-
I am thinking.... that is why devexpress probably added the custom button so one could manipulate the image as one wants..don't know.... – user763539 Jun 04 '14 at 09:28