bootybay Posted March 12, 2015 Share Posted March 12, 2015 I create multiple windows with an image. When ever a new window appears the old source .bmp is already overwritten. Since the Images are still displayed I'd like to copy the selected ones to the clipboard. But I don't seem to be able to get any data from the GUICtrlCreatePic controls. GUICtrlRead doesn't seem to have an option to read picture controls. I googled around and shuffled through the help file already. Did I miss something or do I have to workaround this? Link to comment Share on other sites More sharing options...
BrewManNH Posted March 13, 2015 Share Posted March 13, 2015 Wouldn't it be easier to keep track of what YOUR script is displaying, and then using that information to do whatever it is you want to do? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
mpower Posted March 13, 2015 Share Posted March 13, 2015 (edited) Why not just copy every image as it is created to a Temp directory or similar and display them from there within the gui? This was each image is still stored. Sounds like you need to refine the logic of your script, as what you're thinking of doing, whilst obliviously coming from the right place, seems a little illogical. What I mean is when you're using GUICtrlCreatePic you're obviously using a source image - why not at the same time copy that image to a Temp directory (with any filename you want assigned to the pic)? Edited March 13, 2015 by mpower Link to comment Share on other sites More sharing options...
libreau3 Posted March 13, 2015 Share Posted March 13, 2015 You could do something like this #include <Misc.au3> #include <ScreenCapture.au3> $temp = @TempDir& "\temp.jpg" _ScreenCapture_CaptureWnd($temp,"Window to get the image from",'left','top','right', 'bottum') _ClipPutFile(@TempDir& "\temp.jpg") FileDelete($temp) I hope this helps. Link to comment Share on other sites More sharing options...
bootybay Posted March 13, 2015 Author Share Posted March 13, 2015 (edited) Everyone of you is right. I thought of many ways solving this problem. It's just the way my code grew like this because I'm trying different approaches for practice. (To get out of my comfort zone and to actually understand the downsides to different solutions) @mpower: This is exactly how I initially wanted to solve the problem. But your idea without filesource is much closer of what im trying to do. And it would open even more paths I never came across. How to store an image in a variable etc. Guess I will finally have to take a look into GDI+. Since AutoIt basically stores the displayed images in the memory, I wanted to try retrieving it from there somehow. Like you are able to retrieve data from an edit without unneccessary writes to the harddrive. Why is wrong to assume that it should be possible with displayed images? @libreau3: Thank you for that. This is actually the quickest workaround for the question I asked. @BrewManNH: How exactly do I keep track of what my code is displaying? For now I could only keep track with mpowers method of multiple sourcefiles. By not having to keep track and just being able to "scrap the displayed image off" I would solve this satisfactorily, too. EDIT: You already gave me enough to tinker around for some days. Thank you for your help. Edited March 13, 2015 by bootybay Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now