[已解决]API旋转图片函数
本帖最后由 jhun 于 2010-5-17 14:38 编辑请问一下API旋转图片函数是什么,找了半天没找到:face (30):,谢谢 继续寻求帮助 _GDIPlus_MatrixRotate#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <WinAPI.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $hBitmap1, $hBitmap2, $hImage1, $hImage2, $hGraphic, $width, $height
; 初始化GDI+库
_GDIPlus_Startup()
; 捕捉全屏幕
$hBitmap1 = _ScreenCapture_Capture("")
$hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
; 捕捉屏幕区域
$hBitmap2 = _ScreenCapture_Capture("", 0, 0, 400, 300)
$hImage2 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap2)
$width = _GDIPlus_ImageGetWidth($hImage2)
$height = _GDIPlus_ImageGetHeight($hImage2)
; 将指定图像绘制到另一个
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1)
;DrawInsert($hGraphic, $hImage2, $iX, $iY, $nAngle, $iWidth, $iHeight, $iARGB = 0xFF000000, $nWidth = 1)
DrawInsert($hGraphic, $hImage2, 350, 100, 0, $width + 2, $height + 2, 0xFFFF8000, 2)
DrawInsert($hGraphic, $hImage2, 340, 50, 15, 200, 150, 0xFFFF8000, 4)
DrawInsert($hGraphic, $hImage2, 310, 30, 35, $width + 4, $height + 4, 0xFFFF00FF, 4)
DrawInsert($hGraphic, $hImage2, 320, 790, -35, $width, $height)
; 保存相应的图像
_GDIPlus_ImageSaveToFile($hImage1, @MyDocumentsDir & "\GDIPlus_Image.jpg")
; 清除资源
_GDIPlus_ImageDispose($hImage1)
_GDIPlus_ImageDispose($hImage2)
_WinAPI_DeleteObject($hBitmap1)
_WinAPI_DeleteObject($hBitmap2)
; Shut down GDI+ library
_GDIPlus_Shutdown()
EndFunc ;==>_Main
; #FUNCTION# ==================================================================================================
; 名称..: DrawInsert
; 描述..: 将一个图像绘制到另一个图像中
; 语法..: DrawInsert($hGraphic, $hImage2, $iX, $iY, $nAngle, $iWidth, $iHeight, $iARGB = 0xFF000000, $nWidth = 1)
; 将图形$hImage2插入到$hGraphic中
; 参数..: $hGraphics - 图形对象句柄
; $hImage - 被插入图像的句柄
; $iX - 被插入图像的左上角X坐标
; $iY - 被插入图像的左上角Y坐标
; $iWidth - 围绕插入对象的矩形边界宽度
; $iHeight- 围绕插入对象的矩形边界高度
; $iARGB - 画笔颜色的Alpha, 红色, 绿色和蓝色部分 - 边界色
; $nWidth - 由$iUnit参数指定单位的画笔宽度 - 边界宽度
; 返回值: 成功 - 真
; 失败 - 假
;==================================================================================================
Func DrawInsert($hGraphic, $hImage2, $iX, $iY, $nAngle, $iWidth, $iHeight, $iARGB = 0xFF000000, $nWidth = 1)
Local $hMatrix, $hPen2
; 旋转矩阵
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixRotate($hMatrix, $nAngle, "False")
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage2, $iX, $iY)
; 获取画笔和颜色
$hPen2 = _GDIPlus_PenCreate($iARGB, $nWidth)
; 围绕插入图像绘制一个框架
_GDIPlus_GraphicsDrawRect($hGraphic, $iX, $iY, $iWidth, $iHeight, $hPen2)
; 清除资源
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_PenDispose($hPen2)
Return 1
EndFunc ;==>DrawInsert
API旋转图片函数留脚印专用 以备以后查阅。 看看看,好 打酱油的,混点分数提高下等级,谁然我是路过,但是也不是水帖子
Dragon Nest Gold,vindictus gold,swg credits,silkroad gold,NosTale Gold,Knight Noah,Eden Eternal gold, Elsword ED,tibia gold,shaiya gold,rs2 gold,rohan gold,RIFT Platinum,RIFT Plat,RIFT Gold,rappelz gold,rappelz rupees,perfect world gold,pw gold,Metin2 Yang,Metin2 Gold,maplestory mesos,mabinogi gold,lineage 2 adena,guild wars gold,ffxiv gil,ffxi gil,2moons dil, 4story money, 4story Luna, 4Story Gold, 9Dragons gold, Aion Kinah, Buy Aion Kinah, Buy Aion Gold, apb gold, Cabal Alz, Cabal Gold, dfo gold, dofus kamas, EVE ISK, eq2 plat, 好强大,留用。。。。。。。 找了好久,收藏
页:
[1]