Jump to content

timistar

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by timistar

  1. hi and thanks for read i see other post where the coder tray to load image file, crop or resize a and save a the new image, i tested diferent`s codes but i cant crop a part of a image what i need, can you please help give a help about how a can do this (no is the all code is the func or the link of the post ) all codes what i see the func crop a specific region of the image or used a print screen to crop, i try do wallapers from mi mobile phone, yea p is moore easy by photoshop , but dont moore funny ps i used this code to load, resize and ad the button crop and save dont dont work y mi newbie level (let you the original ocde, with out mi posible errors) thx many http://www.autoitscript.com/forum/index.php?showtopic=95357&st=0&p=685512&hl=flip&fromsearch=1&#entry685512 #include <FreeImage.au3> Global $ImageHandle=-1, $WorkingFileName, $FIF _FreeImage_LoadDLL(@ScriptDir&"\FreeImage.dll") _FreeImage_Initialise() Func OnAutoItExit() If $ImageHandle <>-1 Then _FreeImage_Unload($ImageHandle) _FreeImage_DeInitialise() EndFunc GUICreate("FreeImage Test GUI",800,700) $ShowPic = GUICtrlCreatePic("",0,0, 800,600) $btnOpen = GUICtrlCreateButton("Choose File", 10, 610, 100, 30) GUICtrlSetTip(-1,"Only a copy of the image will be used") $btnFlipH = GUICtrlCreateButton("Flip Horizontal", 120, 610, 100, 30) $btnFlipV = GUICtrlCreateButton("Flip Vertical", 230, 610, 100, 30) $btnRotate = GUICtrlCreateButton("Rotate ...", 340, 610, 100, 30) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $btnOpen _OpenImage() Case $btnFlipH If $ImageHandle <> -1 Then _FreeImage_FlipHorizontal($ImageHandle) _FreeImage_SaveU($FIF, $ImageHandle, $WorkingFileName) _ShowImage() EndIf Case $btnFlipV If $ImageHandle <> -1 Then _FreeImage_FlipVertical($ImageHandle) _FreeImage_SaveU($FIF, $ImageHandle, $WorkingFileName) _ShowImage() EndIf Case $btnRotate If $ImageHandle <> -1 Then $hImageNew = _FreeImage_RotateClassic($ImageHandle, Number(InputBox("Rotate", "angle for rotation", 90))) _FreeImage_SaveU($FIF, $hImageNew, $WorkingFileName) _FreeImage_Unload($ImageHandle) $ImageHandle = $hImageNew _ShowImage() EndIf EndSwitch WEnd Func _OpenImage() Local $sFile = FileOpenDialog("Choose Image","", "Image Files (*.jpg;*.jpeg;*.bmp;*.gif)", 3) If @error Then Return If $ImageHandle <> -1 Then _FreeImage_Unload($ImageHandle) Local $dot = StringInStr($sFile,".",1,-1) Local $Name = StringLeft($sFile,$dot-1) Local $Ext = StringMid($sFile,$dot) $WorkingFileName = $Name &"_FI4AU3"&$Ext FileCopy($sFile,$WorkingFileName) $FIF = _FreeImage_GetFileTypeU($WorkingFileName) If $FIF = $FIF_UNKNOWN Then $FIF = _FreeImage_GetFIFFromFilenameU($WorkingFileName) EndIf $ImageHandle = _FreeImage_LoadU($FIF, $sFile) _ShowImage() EndFunc Func _ShowImage() Local $Width, $Height _SizeProportional($Width, $Height, 800, 600, _FreeImage_GetWidth($ImageHandle), _FreeImage_GetHeight($ImageHandle)) GUICtrlSetPos($ShowPic,0,0,$Width, $Height) GUICtrlSetImage($ShowPic, $WorkingFileName) EndFunc Func _SizeProportional(ByRef $Width, ByRef $Height, $WDesired, $HDesired, $WSrc, $HSrc) ; Prog@ndy Local $RatioDes = ($WDesired / $HDesired) Local $CurrentRatio = ($WSrc / $HSrc) If $CurrentRatio > $RatioDes Then ; scale height $Width = $WDesired $Height = $WDesired / $CurrentRatio Else ; scale width $Width = $HDesired * $CurrentRatio $Height = $HDesired EndIf EndFunc ;==>_SizeProportional thx
  2. somebody can send my or repost the zip with the file database.viri the link is dead thx
  3. thx by the fast answer and sorrry by mi late answer, i keep the problem with your code or with mi code when i try to copy the new files of the usb in the folder dont copy
  4. gracias men lo traducire al español y lo pondre en nuestro foro thx men i will translate to spanish and put in our forum http://www.emesn.com/autoitforum/index.php
  5. muchas gracias many thx i will transdlate to spanish
  6. hi somebody can tell waht is wrong with this, i can`t understand , i`m very very new with autoit and programing thx mi intention is using the filegetime see the dif date between 1 file in the pc and the files into pendrive and copy only the files created after the create the date of the reference file thx #Include <File.au3> #Include <Array.au3> #Include <date.au3> Dim $aDrives = _DriveGet() $1Time = FileGetTime("C:\error.log");reference file only for the FileGetTime $Time1 = $1Time[2] & "/" & $1Time[1] & "/" & $1Time[0] $drv = _DriveGet() $FileList=_FileListToArray($drv) $usb = FileGetTime ($FileList) $usbdrive= $usb[2] & "/" & $usb[1] & "/" & $usb[0] If $time1 < $usb Then dircopy ("c:\westwood", "c:\lir", 1); folder for test purpouses EndIf #cs mi intention is copy the file contained into the pendrive to a folder in other loction , but i can`t if no copy copy all files , i nned copy only the created afted the reference file no all but have the proble m of "sub scruipt used with out array varable o r something by the style " #ce ;*****func detectar usb por gna08 Func _DriveGet() Local $aDrive = DriveGetDrive("REMOVABLE") If @error Then Return False Local $iCount = 0, $aRetDrive[1], $i For $i = 1 To $aDrive[0] If ($aDrive[$i] = "a:") Or (DriveStatus($aDrive[$i]) <> "READY") Then ContinueLoop $aRetDrive[0] += 1 ReDim $aRetDrive[$aRetDrive[0] + 1] $aRetDrive[$aRetDrive[0]] = StringUpper($aDrive[$i]) Return StringUpper($aDrive[$i]) $iCount += 1 Next If $iCount <> "0" Then Return True Return $aRetDrive EndFunc many many thx
  7. nice thx a anti virus por pendrive will be so usefull something agauinst *.ini or *.inf
  8. sorry but 1 ask hows works i complie , and run , selct mi old scripts and appear other windwo with root directot adn aftar taht waht nothing happen and sorry by mi english thx
  9. increible men wowwww
  10. While 1 $aDgD = DriveGetDrive("REMOVABLE") ;..... Sleep(50) WEnd wow men , remember in the sleep comand 1000 = 1 second that was the reaseon why your pen dirve damaged , uf you put less of 1000 that is near the speed light and the chip burn
×
×
  • Create New...