Skip to content

tmplinshi/Scale9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scale9

https://en.wikipedia.org/wiki/9-slice_scaling

Functions

  • Scale9_BitmapToBitmap(pBitmap, NewWidth, NewHeight, SizeArray, bDisposeImage := true)

  • Scale9_FileToBitmap(FileName, NewWidth, NewHeight, SizeArray)

  • Scale9_BitmapToHBitmap(pBitmap, NewWidth, NewHeight, SizeArray, bDisposeImage := true, Background=0xffffffff)

  • Scale9_FileToHBitmap(FileName, NewWidth, NewHeight, SizeArray, Background=0xffffffff)

The parameter SizeArray is an 4 values array: [LeftSize, TopSize, RightSize, BottomSize]

SizeArray.png

Example

#Include <Gdip_All>

pToken := Gdip_Startup()
hBitmap := Scale9_FileToHBitmap("test.png", 400, 400, [40,41,43,43])
Gdip_Shutdown(pToken)

Gui, Add, Pic,, HBITMAP:%hBitmap%
Gui, Show

Screenshots

Scale9 Example 1.png

Scale9 Example 2.png