这段vbs如何改成au3代码???????
这段vbs如何改成au3代码set myImg = loadpicture("c:\back.jpg")
iWidth = round(myImg.width / 26.4583)
iHeight = round(myImg.height / 26.4583)
if iwidth = "800" and iheight = "600" Then
msgbox iwidth&" * "&iheight
else
msgbox "出错"
end if 点解无人回复的???????????? 很简单的啊,学习下Autoit语法就好啊,其实基本上是一样的! au3没有直接获取图片宽度和高度的方法。 可以用UDF的。。论坛里很多例子,什么水印啦,放大镜啦。。都是些针对图片的操作。。 au3没有直接获取图片宽度和高度的方法。
sensel 发表于 2009-4-22 20:56 http://www.autoitx.com/images/common/back.gif
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <WinAPI.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $hBitmap, $hClone, $hImage, $iX, $iY
; Initialize GDI+ library
_GDIPlus_Startup ()
; Capture 32 bit bitmap
$hBitmap = _ScreenCapture_Capture ("")
$hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBitmap)
; Create 24 bit bitmap clone
$iX = _GDIPlus_ImageGetWidth ($hImage)
$iY = _GDIPlus_ImageGetHeight ($hImage)
$hClone = _GDIPlus_BitmapCloneArea ($hImage, 0, 0, $iX, $iY, $GDIP_PXF24RGB)
; Save bitmap to file
_GDIPlus_ImageSaveToFile ($hClone, @MyDocumentsDir & "\GDIPlus_Image.bmp")
; Clean up resources
_GDIPlus_ImageDispose ($hClone)
_GDIPlus_ImageDispose ($hImage)
_WinAPI_DeleteObject ($hBitmap)
; Shut down GDI+ library
_GDIPlus_ShutDown ()
EndFunc ;==>_Main
学习楼上的代码
页:
[1]