本帖最后由 C.L 于 2010-6-20 10:06 编辑
给楼主做了个例子,同图片,插入多个不同位置的例子。#include <ScreenCapture.au3>
Opt('MustDeclareVars', 1)
_ScreenCapture_Capture ("1.jpg");生成示例底图
_ScreenCapture_Capture ("2.jpg", 0, 0, 200, 150);生成要插入的示例小图
_MakeImage("1.jpg","2.jpg","result.jpg",100,100)
ShellExecute("result.jpg")
Func _MakeImage($bgImagefile,$InsImagefile,$toImagefile,$x,$y)
Local $hImage1, $hImage2, $hGraphics
_GDIPlus_Startup ()
$hImage1 = _GDIPlus_ImageLoadFromFile($bgImagefile)
$hImage2 = _GDIPlus_ImageLoadFromFile($InsImagefile)
$hGraphics = _GDIPlus_ImageGetGraphicsContext ($hImage1)
_GDIPlus_GraphicsDrawImage ($hGraphics, $hImage2, $x, $y);插入第一个
_GDIPlus_GraphicsDrawImage ($hGraphics, $hImage2, $x+200, $y+200);插入第二个
_GDIPlus_GraphicsDrawImage ($hGraphics, $hImage2, $x+400, $y+400);插入第三个
_GDIPlus_ImageSaveToFile ($hImage1, $toImagefile)
_GDIPlus_ImageDispose ($hImage1)
_GDIPlus_ImageDispose ($hImage2)
_GDIPlus_ShutDown ()
EndFunc
|