Posts: 81
Threads: 31
Joined: Mar 2015
08-03-2020, 01:58 AM
(This post was last modified: 08-03-2020, 01:59 AM by luvu2des.)
function str'fileName
opt err 1
LoadFreeImageDLL
#compile "__FreeImage"
FiBitmap x, xG
__GdiHandle hb
str getS setS ST1 fileName2
if(empty(fileName)) fileName = "c:\test.bmp"
fileName2 = fileName
CaptureImageOnScreen 1 1 1119 680 fileName;err ret
getS.getfile(fileName)
x.LoadMem(FIMG.FIF_BMP getS)
xG.Attach(FIMG.FreeImage_ColorQuantizeEx(x,0,16,0,0))
fileName.findreplace(".bmp")
ST1.format("%s.jpg" fileName)
xG.SaveMem(FIMG.FIF_PNG setS)
setS.setfile(ST1)
del- fileName2
ret
Hello ~ Gintaras~ and everyone !!
I tried to get screen capture to BMP image and manipulate to lower colors & size, save to JPG and succeeded.
but I wonder how I could this without saving BMP image first.
Thanks in advance !!!
Posts: 1,337
Threads: 61
Joined: Jul 2006
08-03-2020, 02:19 AM
(This post was last modified: 08-03-2020, 02:21 AM by Kevin.)
i don't have free image but from a quick look could probably do something like this
instead of saving the file get the bitmap handle from CaptureImageOnScreen
FiBitmap x xG
__GdiHandle hb
CaptureImageOnScreen 1 1 1119 680 "" hb;err ret
x.FromHBITMAP(hb)
xG.Attach(FIMG.FreeImage_ColorQuantizeEx(x,0,16,0,0))
Posts: 81
Threads: 31
Joined: Mar 2015
Kevin, Thanks ! but I tried as you said and it didn't work.
Posts: 117
Threads: 5
Joined: Nov 2015
Try this:
function str'fileName
opt err 1
#compile "__FreeImage"
FI_ShowMoreErrorInfo
FiBitmap x y
__GdiHandle hb
if(empty(fileName)) fileName = "c:\test.jpg"
CaptureImageOnScreen 1 1 1119 680 "" hb;err ret
x.FromHBITMAP(hb)
y.Attach(FIMG.FreeImage_ColorQuantizeEx(x,0,16,0,0))
y.Save(FIMG.FIF_JPEG fileName)
Posts: 81
Threads: 31
Joined: Mar 2015
Start_Learning Thank you! this works !!!