Jump to content

How to Trim an Image ?


Recommended Posts

Hey I Wanted to Know if I can Trim This Image ... I just want to delete The Title Bar i want The Content In Body of Program only to show up In the IMage Here's The Code I use 1

#include <ScreenCapture.au3>


Example ()


Func Example()
;Image Directory 

Local $ImgDIr = @ScriptDir & "\GDIPlus_Image.jpg"

 ; Screen Testing Creation 
Local $exScreen 
    $exScreen = GUICreate ("Example Test Screen" , 300 , 400)
    GUISetState(@SW_SHOW)
    Sleep(250)
    
; Screen Capture Function 

 _ScreenCapture_CaptureWnd($ImgDIr, $exScreen)  
 
 
 ; Test 
 
ShellExecute($ImgDIr)

    EndFunc

 

Link to comment
Share on other sites

Not 100% accurate:

#include <ScreenCapture.au3>

Example ()


Func Example()
;Image Directory

Local $ImgDIr = @ScriptDir & "\GDIPlus_Image.jpg"

; Screen Testing Creation
Local $hGUI
$hGUI = GUICreate ("Example Test Screen" , 300 , 400)
GUISetState(@SW_SHOW)
Sleep(250)

Local $a1 = WinGetPos($hGUI)
Local $a2 = WinGetClientSize($hGUI)

$iYCaption = _WinAPI_GetSystemMetrics(4)
$iYFixedFrame = _WinAPI_GetSystemMetrics(8)
$iXFixedFrame = _WinAPI_GetSystemMetrics(7)
If $a1[2] < $a2[0] + $iXFixedFrame And $a1[3] < $a2[1] + $iYFixedFrame Then
$iYCaption = 0
$iYFixedFrame = 0
$iXFixedFrame = 0
EndIf

Local $x1 = $a1[0] + $iXFixedFrame
Local $y1 = $a1[1] + $iYCaption + $iYFixedFrame
Local $x2 = $x1 + $a2[0] - 1
Local $y2 = $y1 + $a2[1] - 1

; Screen Capture Function
_ScreenCapture_Capture($ImgDIr, $x1, $y1, $x2, $y2)


; Test
ShellExecute($ImgDIr)

EndFunc

 

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...