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.
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
Related
I am trying to upload image to web site via upload box
but the problem is that upload box does not accept any values
any try to send image to that upload box just opens it but can not send image path to it
how to deal with windows download box
You should first inspect the page (F12) and identify the xpath of the input webElement (could be something like this: //div[#id='input_field']).
Then you should use the selenium keyword 'choose file(locator,file_path)'.Selenium Keywords
I see that you also mentioned 'download box' in your question,if you have another question about that please create another question and I could answer it.
Wait Until Element is Enabled //button[#id='upload1btn']
Choose File //button[#id='upload1btn'] path_to_file
#COMMENT: DO NOT FORGET IMPORT OF SELENIUM LIBRARY
I am developing electron app. I am looking for way in which when user clicks on button then user can download the file from server at specific location ( save dialog).
I have tried various ways but none of them worked. I am looking for code. Thanks
https://gist.github.com/8839edb51e2b11e93a25ae3bb1d83166
Here's a minimal Gist example, openable from Electron Fiddle.
The crux of the code is that you should be using the dialog.showSaveDialog API to let the user choose a path for your file, and then use your preferred JavaScript method to write the file from the server to your filesystem.
IPC is used such that the button can tell the main process (which triggers the dialog and handles the filesystem operation) to do begin its work.
A good option would be using Electron-dl (https://github.com/sindresorhus/electron-dl). They present several options according to your usage.
I am developing an ASP.NET Core application & I need a control as described below:
Is there an existing control or a way to allow users to insert images in a textbox.
There is no way to simply insert an image into a textbox. WYSIWYG editors like TinyMCE give the appearance that this happening by rendering a HTML area with an img tag pointing to an image file at some location. In the end, what's submitted is this backing HTML, not the image itself.
For something like an image that already exists at some publicly-accessible location online, nothing more is required. However, if you're talking about allowing a user to embed an image that exists only on their local filesystem, that requires additional machinery. Again, WYSIWYG editors like TinyMCE often include something along the lines of a "file browser" or "upload" control that handles this type of thing. When the user picks an image from their computer, the control uploads that image to some location on the server and then, again, adds a simple img tag pointing to the now online location of that image. This has to be configured, though. There's usually server-side scripts that must be installed on the server and you have to somehow tell it both where to store the uploaded images and how to address them from a publicly-accessible URL. This is likely what you're missing with TinyMCE. However, setting all that up is beyond the scope of Stack Overflow. Consult the documentation for your library of choice.
I want to write a small app that does some data manipulation on the contents of a simple text file.
I just want to be able to right click such a file, choose 'Open with' in Windows, select my app, then the app opens, parses the file, does some stuff and closes immediately again.
Question: when my app starts, how do I get the file name that triggered the app to start?
Thanks!
You get the file as parameter number 1.
You can get it with the function ParamStr(1).
Have a look here for more details:
http://www.delphibasics.co.uk/RTL.asp?Name=ParamStr
For your information, ParamStr(0) is the filename (including complete path) of your EXE application.
I'm having trouble working on FileReference download(URL) function. I needed to automatically download the files in a particular space on my harddisk but the SAVE AS dialog always displays. can I make it automatically download in a certain place on my disk?
I'm going to assume "automatically download" means "save" here. Nope, If you use FileReference (or File in AIR), there's no way to automatically save without showing the Save As dialog box.
If you don't need to access the file outside of the app, then take a look at the SharedObject class: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html. By default you can create SharedObjects of up to 100KB without needing the client's permission (see the description of getLocal()), which should be fine for more simple text or xml info - you can compress it using ByteArray if you want to save space. Any more than that and a small dialog will open asking permission. Once you've given permission however, it won't ask again.