LoginSignup
0
0

More than 5 years have passed since last update.

[AutoHotKey]コマンドラインでTwitterに画像投稿するとき、添付画像をプレビューする関数

Posted at

↑の続きでもある。

こんな感じ。

SplashImageで画面左上から4つまで並べます。(Twitterが4つまでだから)

画像が縦長でも横長でもよしなに並べます。

ahk
SplashTile(img,length)
{
    gui,add,picture,hwndmypic,%img%
    controlgetpos,,,width,height,,ahk_id %mypic%
    ; via https://autohotkey.com/board/topic/12001-finding-the-widthheight-of-a-picture/
    if (width > height)
    {
        zH = -1
        zW = %length%
        zX = 0
        ZY := (length - (height * (length / width))) / 2
    }
    Else
    {
        zH = %length%
        zW = -1
        zX := (length - (width * (length / height))) / 2
        ZY = 0
    }
    static X
    static Y
    static counts
    counts += 1
    If (counts = 1 or counts = 3)
        X = 0
    Else
        X := length + 5
    If (counts < 3)
        Y = 0
    Else
        Y := length + 25
    H := (length + 20)
    SplashImage, %counts%:%img%, A B2 W%length% H%H% X%X% Y%Y% ZH%zH% ZW%zW% ZX%zX% ZY%zY% CWBlack CTWhite, , %counts%,
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0