How do I use flags (scale and crop) with other arguments in ImagePutWindow? (More/more detailed examples please.)
Closed this issue · 5 comments
The main reference for ImagePutWindow documents the arguments (title, pos, style, etc.) individually but doesn't discuss calling the function with keyword instead of positional arguments. Then in the documentation for the flags, we get examples with keyword arguments for the image and the flags, but no examples/discussion of how to include other arguments (pos, title, etc.) when calling with flags.
I couldn't figure it out — my AHK is occasional — so I took the long way round: scaled with ImagePutBuffer first, then called ImagePutWindow with positional arguments, starting with the buffer pointer.
Additional examples using all the arguments, in both positional and keyword versions, would be appreciated, for those of us beginners, with perhaps a little explanation. Thanks.
Feel free to suggest any changes to the documentation.
ImagePutWindow({image: "cats.jpg", scale: 2}, "My Title", [0, 0])
You can replace the image
parameter with an object. Positional arguments are handled normally.
For examples, please suggest what examples you would like to see. And if they are included as a download, file, or as text in the documentation.
Those examples are very helpful, thanks.
A short explanation as to when and how the different types of parameters are used and how they are combined (and maybe what not to do) would also be nice. After seeing the examples, I think the basic idea is that if you use any of the flags, then you must use a keyword argument for the image type and the flags, and place the combination of the image type and flag keyword arguments in curly brackets as the first positional argument in your call. I'm sure there's a simpler way to say that.
Appreciate very much your work.
I'm sure there's a simpler way to say that.
I'm not too sure about that. I'd have to resort to phrases like positional arguments, keywords, wrapper objects, generic types. So, I deleted that. I think Examples short and succinct can do the trick.
I'll close this ticket for now.