Using image without writing it to a file? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
kyuuuri
Posts: 213
Joined: 09 Jan 2016, 19:20

Using image without writing it to a file?

25 Jan 2019, 03:36

Hello, is it possible to use an image without writing it to a file? What I need is something like what can be done in HTML where you can use the Base64 encode of an image instead of having the image in a file.

To be more specific, it would be something like this:

Code: Select all

image = ;all the image goes here in bitmap, base64, anything.

Gui, add,,  %image%
Would that be impossible without changing ahk's source code?
swagfag
Posts: 2983
Joined: 11 Jan 2017, 17:59

Re: Using image without writing it to a file?  Topic is solved

25 Jan 2019, 04:19

yes:

Code: Select all

#Include <Gdip_All> ; https://github.com/mmikeww/AHKv2-Gdip/blob/master/Gdip_All.ahk

Gdip_Startup()

image := "iVBORw0KGgoAAAANSUhEUgAAAgUAAABOCAYAAACwnGWLAAAaa0lEQVR42uydwW4TVxSGvagQQipCFQuoSsO6m0plhVrJfYNuqCqhSryBi2DVTR6hj+BXgJYFChVKEaQBRDV2aAgRClZiEjs1xpgQ0rSLqX+LU7i+4xzfmbHHM/Mf6V+YjMdz/zHnfPfcO0lhhDjU0+GRdfLMkWmW01igg4P+0b/x+sdgMBhJx+27f5xa+P3u2UZze2lzc9NfX1/va+1pbaiePHmSZgWOqV6v+81mc+nO4v2zt+9XT9E/+peofwwGgzHpqPy5cmar0fDqzzab7RcdH+p2u3731c7/2tlJuzCO4cKYRfX6M39t7Wlzq9H0Vh4//oL+0b9E/WMwGIxJxY0bv366UX9W2dxq+K3n7b46nY6h8MkZ75mUQl2HNdZWq9VXo9Hwl5eX/Y2NDe+3hfunYvAvdT7qSsC/LHjo7h87BgwGYzLxy7VrXz2t1Zrb29s+1G63DWHGtre3Z+rvfRFeW9p9E6Dd4dp5vesi+xxvnIQxvS9jvOIDWti1Ws2vVCrNq1d//jKkf+JhJn3svOxCk/Avqx4aQLD9VwsCEECmfwwGgzH2OP314dXV1SralZKIMEsRYSaz/8+/llwTsej1riEkVWfhfabcE/GrnV1I2rXGmMUHrO2ura35nuf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p/xVxR/FhSYlFnYXMitHQsK9JMaAWcb5gzInTuWcGFo9vb2zmGUAXSB98OIEphfR3mMMpzU4eHhdevhw0eVsYnJxJGNAMaf8VcEfxYUmNyAo66bNy0gECX/nITbPqysiG2x3N9AePn264uL3y4dHBzAKBMwRv0Asp5O4P0FlOv7pTdLt38vL9e+rrzy5kTiyEYI8re/v982/oy/fvCHfoKlpeUn/Nmnk01MTPpdLRi/f/+z6dhwnx8fH18TacYxiqI8gHtlRU/mRGl7d3f30ecPHnzIJjnC+DP+CuHPxMTEpJ9fSkS2Fn/++Kutra2/8BlblCs1oLLQLX79rSNS70VH4RpY/htxdHQkIObS4Y5HhvbPxsbG77Va7cuYq4nKWx8/leX6/G1ubv4R7/3+a/wZfz3i7zrm70+XP9s6MDExyelkwxenpqenP52fn/95be2XC3xqFmg0GgKrq6v9RvC+a2trLsT/9wLr6+v888Xc3Fx9Zmbmk5ifN2KMgSvjz/grkD+rEpiYmPRdmLWNx5iMcTfGbAxkJ4sxvovxfYIfKpXnfgyj8lO5QT3DwPqStX4T44sY93CwDgwyyrbcCzf+jL+C+LMqgYmJSX69BSjjwvgkzUyTyTvR78Woxng/wQcOPrrR4DoIrO/5l6qJU3obnd4JF2Nux7zxZ/wVxZ8FBSYmJrkGBs7nlMcB7PUiU/Ew9QQvvHZnUAAn5ACG+FWAJVvC+DP+iuLPtg5MTEzyF7f5C8BerwsYqvGpW4MKZKqAs/5Rwvgz/nLmzwICExOTclUNsI8JwEA5hmqg4K4tZIyNP+MvL/4sGDAxMSmzjAjAUA8g/HUaf8ZfEfxZ34CJiUlR8h8l8hHA9nXl5wAAAABJRU5ErkJggg=="
pBitmap := Gdip_BitmapFromBase64(image)
hbm := Gdip_CreateHBITMAPFromBitmap(pBitmap)

Gui Add, Picture, , HBITMAP: %hbm%
Gui Show
ofc, dont leak in ur actual code
kyuuuri
Posts: 213
Joined: 09 Jan 2016, 19:20

Re: Using image without writing it to a file?

25 Jan 2019, 06:00

swagfag wrote:
25 Jan 2019, 04:19
yes:

Code: Select all

#Include <Gdip_All> ; https://github.com/mmikeww/AHKv2-Gdip/blob/master/Gdip_All.ahk

Gdip_Startup()

image := "iVBORw0KGgoAAAANSUhEUgAAAgUAAABOCAYAAACwnGWLAAAaa0lEQVR42uydwW4TVxSGvagQQipCFQuoSsO6m0plhVrJfYNuqCqhSryBi2DVTR6hj+BXgJYFChVKEaQBRDV2aAgRClZiEjs1xpgQ0rSLqX+LU7i+4xzfmbHHM/Mf6V+YjMdz/zHnfPfcO0lhhDjU0+GRdfLMkWmW01igg4P+0b/x+sdgMBhJx+27f5xa+P3u2UZze2lzc9NfX1/va+1pbaiePHmSZgWOqV6v+81mc+nO4v2zt+9XT9E/+peofwwGgzHpqPy5cmar0fDqzzab7RcdH+p2u3731c7/2tlJuzCO4cKYRfX6M39t7Wlzq9H0Vh4//oL+0b9E/WMwGIxJxY0bv366UX9W2dxq+K3n7b46nY6h8MkZ75mUQl2HNdZWq9VXo9Hwl5eX/Y2NDe+3hfunYvAvdT7qSsC/LHjo7h87BgwGYzLxy7VrXz2t1Zrb29s+1G63DWHGtre3Z+rvfRFeW9p9E6Dd4dp5vesi+xxvnIQxvS9jvOIDWti1Ws2vVCrNq1d//jKkf+JhJn3svOxCk/Avqx4aQLD9VwsCEECmfwwGgzH2OP314dXV1SralZKIMEsRYSaz/8+/llwTsej1riEkVWfhfabcE/GrnV1I2rXGmMUHrO2ura35nuf5K49XK9j85ugfhGSfZR8BBeP2L/sedroCBAf7x2AwGGOOo16lKpu6jMTcfWUkYaOYvuzuiFAULKHQDght4WFCMnRV0HmCPnfw2oykjusfVtAgbAZDC/fBgwd+z6sjin8KWGXWR7zGuOP0L48e6v4xGAzGmOP4vXv3+rue1zfqaPlC/Zbt/v6+CEkLkCBKcyKGrA1eQQUNnvRmsf7Dhw/9+fl5v3Ds9LGeXx+M4J+00PPkI94n45ciH9U/CJ+dJw/17x+DwWCMMU7cvrOAGQnWLyUhIfFKEkZLFAkrC4lYrtmSA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Fn/++Kutra2/8BlblCs1oLLQLX79rSNS70VH4RpY/htxdHQkIObS4Y5HhvbPxsbG77Va7cuYq4nKWx8/leX6/G1ubv4R7/3+a/wZfz3i7zrm70+XP9s6MDExyelkwxenpqenP52fn/95be2XC3xqFmg0GgKrq6v9RvC+a2trLsT/9wLr6+v888Xc3Fx9Zmbmk5ifN2KMgSvjz/grkD+rEpiYmPRdmLWNx5iMcTfGbAxkJ4sxvovxfYIfKpXnfgyj8lO5QT3DwPqStX4T44sY93CwDgwyyrbcCzf+jL+C+LMqgYmJSX69BSjjwvgkzUyTyTvR78Woxng/wQcOPrrR4DoIrO/5l6qJU3obnd4JF2Nux7zxZ/wVxZ8FBSYmJrkGBs7nlMcB7PUiU/Ew9QQvvHZnUAAn5ACG+FWAJVvC+DP+iuLPtg5MTEzyF7f5C8BerwsYqvGpW4MKZKqAs/5Rwvgz/nLmzwICExOTclUNsI8JwEA5hmqg4K4tZIyNP+MvL/4sGDAxMSmzjAjAUA8g/HUaf8ZfEfxZ34CJiUlR8h8l8hHA9nXl5wAAAABJRU5ErkJggg=="
pBitmap := Gdip_BitmapFromBase64(image)
hbm := Gdip_CreateHBITMAPFromBitmap(pBitmap)

Gui Add, Picture, , HBITMAP: %hbm%
Gui Show
ofc, dont leak in ur actual code
Is this compatible with AhK_L ?

@edit: I have a png image that weights around 1,45MB. When it is encoded as Base64 it weights around 2MB. When I input the image in the code (it has around 2.000.000 letters) I get an error that says: Error: This line does not contaign a recognized action. And it points to the line where I have:
image = all the image thing
I tried changing it to:
image := "all the image thing"
and got this error: Line Text: Error: Missing close-quote
swagfag
Posts: 2983
Joined: 11 Jan 2017, 17:59

Re: Using image without writing it to a file?

25 Jan 2019, 06:17

its compatible with whatever the latest v1 unicode x64 version of ahk is, at the time of posting
its probably compatible with the remaining latest variants, i havent checked
swagfag
Posts: 2983
Joined: 11 Jan 2017, 17:59

Re: Using image without writing it to a file?

25 Jan 2019, 06:19

a single line can only ever contain 16k or so characters
ull have to split ur image into lines if u wanna include it that way
DRocks
Posts: 513
Joined: 08 May 2018, 10:20

Re: Using image without writing it to a file?

25 Jan 2019, 06:20

Can VarSetCapacity help here?
kyuuuri
Posts: 213
Joined: 09 Jan 2016, 19:20

Re: Using image without writing it to a file?

25 Jan 2019, 06:20

Doing something like this would work?

Code: Select all

image := "16k lines" .
. "16k lines" .
...
Hellbent
Posts: 736
Joined: 23 Sep 2017, 13:34

Re: Using image without writing it to a file?

25 Jan 2019, 06:27

kyuuuri wrote:
25 Jan 2019, 06:20
Doing something like this would work?

Code: Select all

image := "16k lines" .
. "16k lines" .
...
How do you create the text for the image?
kyuuuri
Posts: 213
Joined: 09 Jan 2016, 19:20

Re: Using image without writing it to a file?

25 Jan 2019, 06:30

Hellbent wrote:
25 Jan 2019, 06:27
kyuuuri wrote:
25 Jan 2019, 06:20
Doing something like this would work?

Code: Select all

image := "16k lines" .
. "16k lines" .
...
How do you create the text for the image?
Using https://www.browserling.com/tools/image-to-base64 (my image is .png).
kyuuuri wrote:
25 Jan 2019, 06:20
Doing something like this would work?

Code: Select all

image := "16k lines" .
. "16k lines" .
...
Tried something easier using continuation sections but those are limited to 16k as well. What would be the correct way to declare a variable this big (without using another file)?
Hellbent
Posts: 736
Joined: 23 Sep 2017, 13:34

Re: Using image without writing it to a file?

25 Jan 2019, 06:34

kyuuuri wrote:
25 Jan 2019, 06:30
Using https://www.browserling.com/tools/image-to-base64 (my image is .png).
Thank you. Was not aware of this, in the past I had just created a script to get the value of every pixel and then drew it in a loop.

Return to “Ask For Help”

Who is online

Users browsing this forum: BreezeB, kentpachi, malcev, RogerWilcoNL, Zudegia, zvit and 203 guests