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