Button Add Image Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Posts: 721
Joined: 02 Aug 2020, 22:44

Button Add Image

18 Aug 2020, 04:27

I'm wonder if it's possible to have a window open that has the option to enter text and save it in the same window, and then enter an image and save it to the same window. And just repeat the process, moving down so far as to allow the new image to be under the first image?

First row.. Enter text, add image...
Second row (under the first) Enter text and add image
And so on.

Having the add text and add image at the top to use over and over again. So it would need to recognize if it had already sent or added an image, that it would know to move to the next area to add the next image/text. Then have an ini or text file that saves the project so that it open up with the text and images there.

Thank you.
Posts: 1147
Joined: 06 Mar 2017, 16:18
GitHub: AAhkUser
Location: France

Re: Button Add Image  Topic is solved

18 Aug 2020, 17:51

Epialis wrote:
18 Aug 2020, 04:27
Here a sample example (using an html document):

Code: Select all

SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance force

html =
<!DOCTYPE html>
<html lang="en">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" charset="utf-8">
		#test {
			display: flex;
			flex-flow: column nowrap;
			position: fixed;
			top: 0;
			bottom: 0;
			left: 0;
			right: 0;
			margin: 0;
			padding: 20px 20px 20px 20px;
		div.row {
			display: flex;
			flex-flow: row nowrap;
			margin: 4px 4px;
			height: 100`%;
		img.pic {
			margin: 4px 4px;
			width: 100`%;
			height: 100`%;
		<ul id="test">
			<div class="row"></div>
GUI, New
GUI Add, ActiveX, vAXWrapperObject xm y30 w400 h400, about:<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=edge" charset="utf-8">
doc := AXWrapperObject.document
doc.open(), doc.write(html), doc.close()
pics := doc.getElementsByClassName("pic")

GUI, +Resize
GUI, Margin, 5, 5
pathToPic := A_Desktop . "\AutoHotkey modern logo.svg"
UrlDownloadToFile, % "https://www.autohotkey.com/static/ahk_logo.svg", % pathToPic ; let's download the AutoHotkey logo for testing purpose
GUI Add, Button, xm ym w400 vMyButton gpushPic, OK ; add a button and set its g-label to be 'pushPic' (https://www.autohotkey.com/docs/commands/Gui.htm#label)
GUI, Show, AutoSize
rowMax := 5, columnMax := 2
rowCurrent := 0, columnCurrent := 0
cells := rowMax * columnMax

GUISize: ; https://www.autohotkey.com/docs/commands/Gui.htm#GuiSize
	GuiControl, Move, MyButton, % "w" A_GuiWidth - 10
	GuiControl, Move, AXWrapperObject, % "w" A_GuiWidth - 10 "h" A_GuiHeight - 40 ; resize the control so that it fits the new GUI dimensions

	if not (pics.length < cells)
	FileSelectFile, path, 3, % pathToPic, Select a picture, Pictures (*.png; *.svg) ; displays a standard dialog that allows the user to choose a picture
	if (columnCurrent < columnMax) {
		Gosub, subLabel
	} else {
		columnCurrent := 0
		doc.getElementById("test").innerHTML .= "<div class='row'></div>" ; create a new row
		doc.getElementsByClassName("row")[rowCurrent].innerHTML .= "<img class='pic' src='" . path . "'>" ; create a new column and fill it with a picture (https://www.w3schools.com/tags/tag_img.asp)
my scripts
User avatar
Posts: 721
Joined: 02 Aug 2020, 22:44

Re: Button Add Image

18 Aug 2020, 18:22


Thank you kind sir.

Return to “Ask For Help”

Who is online

Users browsing this forum: 20170201225639, Chunjee and 68 guests