Closed sanmaodo closed 2 years ago
use ImageRender. It is part of TextRender. https://github.com/iseahound/TextRender
Sample Script:
#include TextRender (for v1).ahk
#include ImagePut (for v1).ahk
buffer := ImagePutBuffer("media\untitled.png")
ir := ImageRender()
ir.Render(buffer.pBitmap, "t:1.5s k:s s:15 q:0")
Esc:: ExitApp
Also see: https://github.com/iseahound/TextRender/wiki/Styles, the styles are very similar for ImageRender, just that s becomes scale.
think!
hWin := imageputwindow("1.png")
WinSet, Style, -0xC00000, ahk_id %hWin%
imageputwindow return window's hwnd. so you can easily remove the title bar.
Hmm... That does something weird on my system. It's actually very easy to make one without a titlebar. I specifically tried to create a window with a title bar for the ImagePutWindow function. And make the windows without titlebar part of ImageRender.
If I add a window without a titlebar, what do I call this new function? ImagePutWindow is already taken.
ImagePutDisplay ? ImagePutShow ? ImagePutMinWindow ? ImagePutWindow(p1, p2, notitlebar:=true) ?
Alright I've decided on ImageShow().
ImageShow("https://picsum.photos/200")
ImageShow("https://picsum.photos/500", "a random pic", [500])
ImagePutWindow("https://picsum.photos/200/300")
ImagePut.gdiplusStartup()
ImagePut.show(ImagePutBitmap("https://picsum.photos/100"))
It's been added to the main script, feel free to test it out. In addition, ImagePutWindow has been extended to include a position parameter.
Function signature
; title - Window Title | string -> MyTitle
; pos - Window Coordinates | array -> [x,y,w,h] or [0,0]
; style - Window Style | uint -> WS_VISIBLE
; styleEx - Window Extended Style | uint -> WS_EX_LAYERED
; parent - Window Parent | ptr -> hwnd
ImageShow(image, title := "", pos := "", style := 0x10000000, styleEx := 0x80088, parent := 0) {
return ImagePut("show", image, title, pos, style, styleEx, parent)
}
I need an image window without a title bar, can it be achieved?