Gif Topic is solved

Tire suas dúvidas sobre programação em AutoHotkey

Moderator: Gio

User avatar
Hologram
Posts: 140
Joined: 06 May 2020, 16:47

Gif

30 Sep 2020, 07:48

Tem alguma coisa da biblioteca padrao do ahk pra exibiçao de gif em gui?
Discord: Npc Bugado#9074



local config = {
delrey = getPlayerCarValue(cid, DELREY),
cigarro = getPlayerCancer(cid, DERBY),
prostituta = getPlayerAIDS(cid, cracuda),
tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end


User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Gif

30 Sep 2020, 17:07

Boa tarde Hologram.

Você pode usar um controle ActiveX.

Exemplo: Pra exibir o gif anexo a este post em uma gui do autohotkey, basta você salvá-lo como exemplo_de_gif.gif na mesma pasta do script abaixo e executar o script.

Code: Select all

var := A_ScriptDir . "/exemplo_de_gif.gif"  ; ATENCAO !! AJUSTE AQUI O CAMINHO DO ARQUIVO .GIF (GIF ANIMADO).
Gui, Add, ActiveX, x0 y0 w600 h600 vWB, shell explorer
wb.Navigate("about:blank")
html := "<html>`n<title>name</title>`n<body>`n<center>`n<img src=""" var """ >`n</center>`n</body>`n</html>"
wb.document.write(html)
Gui, show, w600 h600 Center

Gif anexo:
exemplo_de_gif.gif
exemplo_de_gif.gif (285.72 KiB) Viewed 718 times
User avatar
Hologram
Posts: 140
Joined: 06 May 2020, 16:47

Re: Gif

01 Oct 2020, 06:53

Na verdade oq ta fazendo o gif aparecer é o html e nao o ahk em si certo?
Acaso for sim, eu posso usar todos elementos de um html comum?
Eu tava querendo deixar o gif em tela cheia, entoa tentei usar assim, mas nao deu bom:

html:

Code: Select all

html := "<html>`n<head>`n<title> Testando </title>`n<meta charset="utf-8" />`n<link rel="stylesheet" type="text/css" href="estilo.css">`n</head><body>`n<img src="Teste.gif" class="largura-cheia" >`n</body>`n</html>"
estilo.css:

Code: Select all

.largura-cheia{
    width:100%;
    height:560px;
}
Discord: Npc Bugado#9074



local config = {
delrey = getPlayerCarValue(cid, DELREY),
cigarro = getPlayerCancer(cid, DERBY),
prostituta = getPlayerAIDS(cid, cracuda),
tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end


User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Gif

01 Oct 2020, 10:15

Bom dia.

Você pode usar todos os elementos de html sim, afinal, é uma das funções do controle ActiveX. Com ele, você pode fazer GUIs tão bem elaboradas quanto qualquer página da web que você já viu.

Mas tem um porém no caso específico que você comentou: como o controle tem dimensões definidas pelo script, creio que colocar no HTML que a página carregue em tela cheia não vai funcionar, pois até onde eu sei, o controle ActiveX tem dimensões bem definidas na GUI do script.

De qualquer forma, você pode criar uma GUI em tela cheia e sem bordas, e depois colocar o controle ActiveX no tamanho da tela inteira.
User avatar
Hologram
Posts: 140
Joined: 06 May 2020, 16:47

Re: Gif

01 Oct 2020, 13:22

assim? n deu bom aqui

Code: Select all

var := A_ScriptDir . "/exemplo_de_gif.gif"  ; ATENCAO !! AJUSTE AQUI O CAMINHO DO ARQUIVO .GIF (GIF ANIMADO).
Gui, Add, ActiveX, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight% vWB, shell explorer
wb.Navigate("about:blank")
html := "<html>`n<title>name</title>`n<body>`n<img src=""" var """ >`n</body>`n</html>"
wb.document.write(html)
Gui, show, w%A_ScreenWidth% h%A_ScreenHeight%, TEST
Discord: Npc Bugado#9074



local config = {
delrey = getPlayerCarValue(cid, DELREY),
cigarro = getPlayerCancer(cid, DERBY),
prostituta = getPlayerAIDS(cid, cracuda),
tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end


User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Gif

01 Oct 2020, 16:21

Além de expandir a GUI, você deve usar outras opções de janelas pra melhorar o efeito.

Code: Select all

var := A_ScriptDir . "/exemplo_de_gif.gif"  ; ATENCAO !! AJUSTE AQUI O CAMINHO DO ARQUIVO .GIF (GIF ANIMADO).
Gui, Add, ActiveX, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight% vWB, shell explorer
wb.Navigate("about:blank")
html := "<html>`n<title>name</title>`n<body>`n<img src=""" var """ >`n</body>`n</html>"
wb.document.write(html)
Gui, +LastFound -Border -Caption
Gui, Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, TESTE

:arrow: ATENÇÃO: A tela fullscreen esconde os controles de borda e a barra de tarefas, então você deve programar uma hotkey ou controles de tela que fechem esta ela (também é possível sair usando alt+tab ou control+shift+esc ou algum outro atalho embutido do windows, mas não deixe seu cliente descobrir isso no desespero :lol: ).
User avatar
Hologram
Posts: 140
Joined: 06 May 2020, 16:47

Re: Gif

01 Oct 2020, 16:37

pior que ainda nao consegui expandir, ficou assim:
1.png
1.png (140.21 KiB) Viewed 683 times
E se eu colocasse a imagem em uma resouçao grande? Tipo 2K por 1.5K, vai dar problema pra monitores pequenos sera?
Discord: Npc Bugado#9074



local config = {
delrey = getPlayerCarValue(cid, DELREY),
cigarro = getPlayerCancer(cid, DERBY),
prostituta = getPlayerAIDS(cid, cracuda),
tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end


User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Gif  Topic is solved

01 Oct 2020, 18:26

Só agora que entendi o que você quer. Pensei que queria expandir a área onde ficará o gif, mas você quer expandir o gif em si.

Bem, você pode usar sim html + CSS pra fazer isso.


Exemplo: No código abaixo, as configurações width e height se referem ao gif e podem ser ajustadas livremente. A sintaxe é número seguido de px e você pode usar as variáveis embutidas A_ScreenWidth e A_ScreenHeight para colocar o total da tela.

Code: Select all

#SingleInstance, Force

Gui, Add, ActiveX, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight% vWB, shell explorer
wb.Navigate("about:blank")

html =
(
<!DOCTYPE html>
<html>
<head>
<style>

img {
  width: %A_ScreenWidth%px;
  height: %A_ScreenHeight%px;
}

</style>
<body>
<img src="%A_ScriptDir%/exemplo_de_gif.gif">
</body>
</html>
)

wb.document.write(html)
Gui, show, w%A_ScreenWidth% h%A_ScreenHeight% Center

:arrow: Quando você for testar, vale lembrar que o gif exemplo que eu usei já contém uma área branca enorme ao redor da lâmpada, então apesar de a lâmpada aparecer somente no centro da tela, o gif em si está na tela toda sim.

:arrow: EDIT: removi a informação de que o ajuste do caminho da imagem seria na variável var (eu coloquei o caminho direto do código html neste último exemplo, e ele deve ser ajustado ali mesmo).

Return to “Ajuda e Suporte Geral”

Who is online

Users browsing this forum: No registered users and 28 guests