Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | |
2 | #constant DLL_DBProImageDebug 1 |
||
3 | #constant FN_DLL_DBProImageDebug "DBProImageDebug.dll" |
||
4 | |||
5 | function resizeImage(image as dword, width as dword, height as dword) |
||
6 | rem https://forum.thegamecreators.com/thread/191558#msg2284289 , modified |
||
7 | rem ATTENTION! Will crash when you try to increase the size (resize small picture into large picture)! |
||
8 | |||
9 | if DLL EXIST(DLL_DBProImageDebug) = 0 |
||
10 | load dll FN_DLL_DBProImageDebug, DLL_DBProImageDebug |
||
11 | ENDIF |
||
12 | |||
13 | call dll DLL_DBProImageDebug, "?Stretch@@YAXHHH@Z", image, width, height // This function won't reset the size |
||
14 | pWidth = make memory(4) |
||
15 | pHeight = make memory(4) |
||
16 | pDepth = make memory(4) |
||
17 | ppData = make memory(4) |
||
18 | pSize = make memory(4) |
||
19 | call dll DLL_DBProImageDebug, "?GetImageData@@YAXHPAK00PAPAD0_N@Z", image, pWidth, pHeight, pDepth, ppData, pSize, 1 |
||
20 | call dll DLL_DBProImageDebug, "?SetImageData@@YAXHKKKPADK@Z", image, width, height, *pDepth, *ppData, *pSize |
||
21 | delete memory pWidth |
||
22 | delete memory pHeight |
||
23 | delete memory pDepth |
||
24 | delete memory ppData |
||
25 | delete memory pSize |
||
26 | endfunction |