Jump to content


Photo

ScreenCapture.ahk - convert + imageMagick


  • Please log in to reply
1 reply to this topic

#1 BrandonHotkey

BrandonHotkey
  • Members
  • 566 posts

Posted 01 June 2012 - 12:12 AM

Hello,
I want to ask you about script ScreenCapture.ahk
<!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=2&t=18146">viewtopic.php?f=2&t=18146</a><!-- l -->

There is a line:
Convert(hBM, sFile, nQuality), DllCall("DeleteObject", "Uint", hBM)
with explanation:
/* Convert(sFileFr, sFileTo, nQuality)
Convert("C:\image.bmp", "C:\image.jpg")
Convert("C:\image.bmp", "C:\image.jpg", 95)
Convert(0, "C:\clip.png") ; Save the bitmap in the clipboard to sFileTo if sFileFr is "" or 0.
*/

Could it be possible to run the command so, that I could run Imagemagick with the Convert result in input? Because I would like to do some color modification/filtering before I will save the image into file.

image magic basic syntax is:
convert sourceimage -effect argument -effect argument targetimage

#2 BrandonHotkey

BrandonHotkey
  • Members
  • 566 posts

Posted 01 June 2012 - 10:15 AM

Once again, when I check the function Convert, there is line:

If pImage
pCodec ? DllCall("gdiplus\GdipSaveImageToFile", "Uint", pImage, "Uint", Unicode4Ansi(wFileTo,sFileTo), "Uint", pCodec, "Uint", pParam) : DllCall("gdiplus\GdipCreateHBITMAPFromBitmap", "Uint", pImage, "UintP", hBitmap, "Uint", 0) . SetClipboardData(hBitmap), DllCall("gdiplus\GdipDisposeImage", "Uint", pImage)

Is it somebody who would know how to change this line to pass the image not to file, but to a program call? To be processed and saved by ImageMagick (convert.exe)

PS: Could you move this thread to Scripts?