Sign in to follow this  
Followers 0
johnmcloud

Math problem

18 posts in this topic

#1 ·  Posted (edited)

Hi guys, i have a math question:

$Widht = 70
$Height = 30

$GUI = GUICreate("Test", $Widht, $Height, 10, 10)
$Label = GUICtrlCreateLabel("00:00", -1, -1, $Widht, $Height)
GUICtrlSetFont($LabelClock, 20, 600)

With font size 20 and the label/gui 70 * 30 it fit perfect, but if i want to make the font size bigger i need to change everytime the GUI size and the label size. How i can make the GUI/Label variable connected to the size of the font? Example i know

Font size = 40

$Widht = 70*2

$Height = 30*2

But if i make the size 17 or 54? Hope is clear what is my goal.

Thanks

Edited by johnmcloud

Share this post


Link to post
Share on other sites



johnmcloud,

Look at the StringSize UDF in my sig - it tells you the dimensions of a string in any given font/size. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I don't know if stringsize is what i need...can you provide an example based on my example? ( Yes, i have see the example in the zip file of the UDF )

Share this post


Link to post
Share on other sites

Yes Melba, understood ( double post? :D ) but i need an easier example, just fit the GUI based on the label font dimesion, too array in yours ;)

Share this post


Link to post
Share on other sites

I facepalmed so hard.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

I facepalmed so hard.

Be careful not to break your head with a facepalm, sorry if i'm not a super mega coder like you.

If you don't want to help, please don't lose your time and don't post here.

Thanks

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hey johnmcloud,

Be calm :)

Using this code u can resize the label

#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Constants.au3>

$X = 300
$Y = 300
$ParenT = GUICreate("", 500, 200, -1, -1, $WS_POPUP)
GUISetState()
$sLabel=GUICtrlCreateLabel('Hey.....asdasdsadasdasdasdasd.....!!',10,10,70,15)
GUICtrlSetBkColor(-1,0)
GUICtrlSetColor(-1,0xFFFFFF)
$sRect=CalcRectangle('Hey.....asdasdsadasdasdasdasd.....!!')
ConsoleWrite('Width Should be: '&$sRect[0]&@CRLF _
& 'Height Should be: '&$sRect[1]&@CRLF)
Sleep(3000)
ConsoleWrite('-> Resizing Successful'&@CRLF)
ControlMove($ParenT,'',$sLabel,Default,Default,$sRect[0],$sRect[1])
Sleep(7000)

Func CalcRectangle($sString, $sFont='Arial',$fFontsize=8.5)
_GDIPlus_Startup()
    Local $aResult, $hFont, $i=0 ,$iLen = StringLen($sString),$tLayout
    Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(WinGetHandle(AutoItWinGetTitle()))
    Local $tRectF = DllStructCreate($tagGDIPRECTF)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFont = _GDIPlus_FontCreate( _GDIPlus_FontFamilyCreate($sFont), $fFontsize, 0)
    Do
$tLayout = _GDIPlus_RectFCreate(0, 0, $i, 0)
        $aResult = DllCall($ghGDIPDll, "int", "GdipMeasureString", _
  "handle", $hGfx, _
  "wstr", $sString, _
  "int", $iLen, _
  "handle", $hFont, _
  "struct*", $tLayout, _
  "handle", $hFormat, _
  "struct*", $tRectF, _
  "int*", 0, _
  "int*", 0)
If $aResult[8] >=  $iLen Then ExitLoop
        $i += 1
    Until False
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_GraphicsDispose($hGfx)
    $tLayout  = 0
Local $sReturn[2]=[DllStructGetData($aResult[7],'Width'),DllStructGetData($aResult[7],'Height')]
_GDIPlus_Shutdown()
    Return $sReturn
EndFunc

Hope so u can carry out the GUI resizing

Regards

Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I'm calm PhonenixXL, don't worry ;)

I'm here for learn, not to be fooled

I have find another example like yours about the label size ( in GDI+ ), the problem is the GUI size:

#include <GDIPlus.au3>
#include <Misc.au3>
$gui = GUICreate("test", 400, 200)
$label = GUICtrlCreateLabel("old", 10, 10, 20, 15)
GUISetState()

updateTXT()

While 1
Sleep(10)
WEnd

Func updateTXT()
MsgBox(0, "", "please choose font and a larger font size")
$font_attributes = _ChooseFont()
If Not @error Then
     $aDim = GetStringSize("old", $font_attributes[2], $font_attributes[3], $font_attributes[1])
     GUICtrlSetPos($label, 10, 10, $aDim[0], $aDim[1])
     GUICtrlSetFont($label, $font_attributes[3], "", "", $font_attributes[2], 4)
     Sleep(2000)
     Exit
EndIf
EndFunc ;==>updateTXT
Func GetStringSize($string, $font, $fontsize, $fontstyle)
Local $GDIp = False
Local $iWidth = StringLen($string) * $fontsize
Local $iHeight = 2 * $fontsize
If Not $ghGDIPDll Then
     _GDIPlus_Startup()
     $GDIp = True
EndIf
Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
Local $hBitmap = $aResult[6]
Local $hGrphContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Local $hFormat = _GDIPlus_StringFormatCreate()
Local $hFamily = _GDIPlus_FontFamilyCreate($font)
Local $hFont = _GDIPlus_FontCreate($hFamily, $fontsize, $fontstyle)
Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
Local $aInfo = _GDIPlus_GraphicsMeasureString($hGrphContext, $string, $hFont, $tLayout, $hFormat)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hGrphContext)
If $GDIp Then _GDIPlus_Shutdown()
Local $aDim[2] = [Int(DllStructGetData($aInfo[0], "Width")), Int(DllStructGetData($aInfo[0], "Height"))]
Return $aDim
EndFunc

I'll wait also for a Melba's solution, but if someone has a new idea about GUI resizing based on a label size i can check it out ;)

Thanks

Edited by johnmcloud

Share this post


Link to post
Share on other sites

Well we can create an offset and then resize the GUI

Example would be better hold a min..


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

johnmcloud,

too array in yours

Arrays are an essential tool - you really need to understand them. :)

Here is the simplest example I can think of: ;)

#include <StringSize.au3>

While 1
    ; Get a font size
    $iFont_Size = Int(InputBox("Font Size", "Enter a size"))
    If $iFont_Size Then
        ; Find the size of the string in the required font
        $aSize = _StringSize("Fits neatly", $iFont_Size, Default, Default, "Arial")
        ; And create the GUI to fit
        $hGUI = GUICreate("Test", $aSize[2], $aSize[3])
        GUICtrlCreateLabel($aSize[0], 0, 0, $aSize[2], $aSize[3])
        GUICtrlSetFont(-1, $iFont_Size)
        GUICtrlSetBkColor(-1, 0xFF0000)
        GUISetState()
        While 1
            If GUIGetMsg() = -3 Then
                GUIDelete($hGUI)
                ExitLoop
            EndIf
        WEnd
    Else
        ExitLoop
    EndIf
WEnd

Does that make it easier to understand? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Here we go

#include 
#include 
#include 
#include 
$ParenT = GUICreate("", 500, 200)
GUISetState()
$sLabel=GUICtrlCreateLabel('Hey.....asdasdsadasdasdasdasd.....!!',10,10,70,15)
GUICtrlSetResizing(-1,802)
GUICtrlSetBkColor(-1,0)
GUICtrlSetColor(-1,0xFFFFFF)
$hPos=ControlGetPos($ParenT,'',$sLabel)
$sRect=CalcRectangle('Hey.....asdasdsadasdasdasdasd.....!!')
ConsoleWrite('Width Should be: '&$sRect[0]&@CRLF _
& 'Height Should be: '&$sRect[1]&@CRLF)
Sleep(3000)
ConsoleWrite('-> Resizing'&@CRLF)
$sGUI=WinGetPos($ParenT)
WinMove($ParenT,'',Default,Default,$sGUI[2]+($sRect[0]-$hPos[2]),$sGUI[3]+($sRect[1]-$hPos[3]))
ControlMove($ParenT,'',$sLabel,Default,Default,$sRect[0],$sRect[1])
Sleep(7000)



Func CalcRectangle($sString, $sFont='Arial',$fFontsize=8.5)
_GDIPlus_Startup()
Local $aResult, $hFont, $i=0 ,$iLen = StringLen($sString),$tLayout
Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(WinGetHandle(AutoItWinGetTitle()))
Local $tRectF = DllStructCreate($tagGDIPRECTF)
Local $hFormat = _GDIPlus_StringFormatCreate()
Local $hFont = _GDIPlus_FontCreate( _GDIPlus_FontFamilyCreate($sFont), $fFontsize, 0)
Do
$tLayout = _GDIPlus_RectFCreate(0, 0, $i, 0)
$aResult = DllCall($ghGDIPDll, "int", "GdipMeasureString", _
"handle", $hGfx, _
"wstr", $sString, _
"int", $iLen, _
"handle", $hFont, _
"struct*", $tLayout, _
"handle", $hFormat, _
"struct*", $tRectF, _
"int*", 0, _
"int*", 0)
If $aResult[8] >= $iLen Then ExitLoop
$i += 1
Until False
_GDIPlus_FontDispose($hFont)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_GraphicsDispose($hGfx)
$tLayout = 0
Local $sReturn[2]=[DllStructGetData($aResult[7],'Width'),DllStructGetData($aResult[7],'Height')]
_GDIPlus_Shutdown()
Return $sReturn
EndFunc

Note with the resize in label equal resize takes place in the GUI too

Hope so this helps :)

Regards

Phoenix XL


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

Ok, this is the UDF of Melba ( i have make more easier lol, i'm just kidding ;) )

#include <StringSize.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

; Get a font size
$iFont_Size = Int(20) ; Size of font
; Find the size of the string in the required font
$aSize = _StringSize("Fits neatly", $iFont_Size, Default, Default, "Arial")
; And create the GUI to fit
$hGUI = GUICreate("Test", $aSize[2], $aSize[3])
GUICtrlCreateLabel($aSize[0], 0, 0, $aSize[2], $aSize[3])
GUICtrlSetFont(-1, $iFont_Size)
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState()

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

And this is PhoneixXl example, i have add WinMove so the GUI automatically fit:

#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Constants.au3>

$X = 300
$Y = 300
$ParenT = GUICreate("", 500, 200, 10, 10, $WS_POPUP)
GUISetState()
$sLabel = GUICtrlCreateLabel('Hey.....asdasdsadasdasdasdasd.....!!', -1, -1)
GUICtrlSetBkColor(-1, 0)
GUICtrlSetColor(-1, 0xFFFFFF)

Sleep(3000)

$sRect = CalcRectangle(GUICtrlRead($sLabel))
WinMove($ParenT,"", 10, 10, $sRect[0], $sRect[1])
ControlMove($ParenT, '', $sLabel, Default, Default, $sRect[0], $sRect[1])

Sleep(3000)

Func CalcRectangle($sString, $sFont = 'Arial', $fFontsize = 8.5)
_GDIPlus_Startup()
Local $aResult, $hFont, $i = 0, $iLen = StringLen($sString), $tLayout
Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(WinGetHandle(AutoItWinGetTitle()))
Local $tRectF = DllStructCreate($tagGDIPRECTF)
Local $hFormat = _GDIPlus_StringFormatCreate()
Local $hFont = _GDIPlus_FontCreate(_GDIPlus_FontFamilyCreate($sFont), $fFontsize, 0)
Do
  $tLayout = _GDIPlus_RectFCreate(0, 0, $i, 0)
  $aResult = DllCall($ghGDIPDll, "int", "GdipMeasureString", _
    "handle", $hGfx, _
    "wstr", $sString, _
    "int", $iLen, _
    "handle", $hFont, _
    "struct*", $tLayout, _
    "handle", $hFormat, _
    "struct*", $tRectF, _
    "int*", 0, _
    "int*", 0)
  If $aResult[8] >= $iLen Then ExitLoop
  $i += 1
Until False
_GDIPlus_FontDispose($hFont)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_GraphicsDispose($hGfx)
$tLayout = 0
Local $sReturn[2] = [DllStructGetData($aResult[7], 'Width'), DllStructGetData($aResult[7], 'Height')]
_GDIPlus_Shutdown()
Return $sReturn
EndFunc   ;==>CalcRectangle

The Phoneix's script seems not cut perfect the label, don't know why. Melba's UDF works fine

Share this post


Link to post
Share on other sites

Yeah,

Clearcut rectangle sometimes go 19, 20

Anyways Congo

U got it working


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Mmm there is a problem with melba UDF, i have try to change the font but:

Posted Image

In the example of the .zip work, why this time not? The font don't change and it doesn't fit

Edited by johnmcloud

Share this post


Link to post
Share on other sites

To change the font of what?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

To change the font of what?

Of the label

_StringSize($sText, $iSize, $iWeight, $iAttrib, $sFont, $iX)

I have make:

$aSize = _StringSize("Fits neatly", $iFont_Size, Default, Default, "Courier New")

But i see this:

Posted Image

Something is wrong, work only with "Arial". I have tested the example in the zip file of the _StringSize and the font change, so i dunno what is wrong

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Of the label

_StringSize($sText, $iSize, $iWeight, $iAttrib, $sFont, $iX)

I have make:

$aSize = _StringSize("Fits neatly", $iFont_Size, Default, Default, "Courier New")

But i see this:

Posted Image

Something is wrong, work only with "Arial"

You have problems with logic, not math. And lack basic understanding of programming.

You did not change the font of the label. You calculated the size of string for one font and then used different font for label. That's what's wrong.

Programming is simple, you just have to learn to learn and learn to think, nothing more. Good luck.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

I have understood the problem:

#include <StringSize.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

; Get a font name
$iFont_Name = "Comic Sans MS"
; Get a font size
$iFont_Size = Int(20) ; Size of font
; Find the size of the string in the required font
$aSize = _StringSize("Fits neatly", $iFont_Size, Default, Default, $iFont_Name)
; And create the GUI to fit
$hGUI = GUICreate("Test", $aSize[2], $aSize[3])
GUICtrlCreateLabel($aSize[0], 0, 0, $aSize[2], $aSize[3])
GUICtrlSetFont(-1, $iFont_Size, 400, 0, $iFont_Name)
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd

@trancexx at the start i think was a math problem, an equivalation or a sort of, i know the gui is 70*30 and the size of the font is 20 and fit, how to calcucate the gui size if font size if is example 17 for fit it?

Thanks to all, know i think i have solved

Edited by johnmcloud

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • jrsofsd
      By jrsofsd
      RunningStats calculates running (moving) statistics: Standard Deviation, Variance, and Mean . The single function _RunningStats(), queries, clears, restores, or adds to the running statistics.
      Example.au3 adds 7 samples of data to running statistics and displays the results using _ArrayDisplay().
      Example-Persistent-Storage.au3 adds the first 6 samples to the running statistics and stores the results in an INI file. The data is read from the INI file and restored to the running statistics. The 7th sample is added and the results displayed, matching the results from Example.au3.
      Credits: John D. Cook for his article "Accurately computing running variance" at http://www.johndcook.com/blog/standard_deviation/
      RunningStats.zip
    • scintilla4evr
      By scintilla4evr
      I started writing this UDF a while ago, so I decided to share it here.
      This is an UDF full of advanced mathematical functions. It allows to work with primes, create number sequences, interpolate, calculate values of functions like Riemann zeta.
      Full list of functions:
       
      Changelog:
      Download
    • Katie_Deely
      By Katie_Deely
      Hey there
      I'm thinking about making a program that will calculate with huge numbers. Well above 1*10^18 probably. Can autoit deal with that? If not, how can I make it work?
      Thanks!
    • rm4453
      By rm4453
      I keep getting error : Statement cannot be just an expression.
      Here are the 3 error variations it gives:
      Global $ImageCount += 1
      ~~~~~~~~~~~~~~~~~~~~~^
      Global $ImageCount += 1
      ~~~~~~~~~~~~~~~~~~~~^
      Global $ImageCount +=
      ~~~~~~~~~~~~~~~~~~~^
      Here is the code:
      Case $Image1 ;GUICtrlSetState($Image1, 4+128) GUICtrlSetState($Image2, 64) $Image1_done = 1 OpenImages() Global $Image1_added = $imagePath ;MsgBox("Info", "Image 1 Path", $Image1_added) OpenEditBox() Global $Image1_Description = $editBox_save If $im1 = 0 Then Global $ImageCount += 1 $im1 = 1 EndIf Case $Image2 If $Image1_done = 1 Then ;GUICtrlSetState($Image2, 4+128) GUICtrlSetState($Image3, 64) OpenImages() Global $Image2_added = $imagePath ;MsgBox("Info", "Image 2 Path", $Image2_added) OpenEditBox() Global $Image2_Description = $editBox_save $Image2_done = 1 If $im2 = 0 Then Global $ImageCount += 1 $im2 = 1 EndIf Else EndIf Case $Image3 If $Image2_done = 1 Then ;GUICtrlSetState($Image3, 4+128) GUICtrlSetState($Image4, 64) OpenImages() Global $Image3_added = $imagePath ;MsgBox("Info", "Image 3 Path", $Image3_added) OpenEditBox() Global $Image3_Description = $editBox_save $Image3_done = 1 If $im3 = 0 Then Global $ImageCount += 1 $im3 = 1 EndIf Else EndIf Case $Image4 If $Image3_done = 1 Then ;GUICtrlSetState($Image4, 4+128) GUICtrlSetState($Image5, 64) OpenImages() Global $Image4_added = $imagePath ;MsgBox("Info", "Image 4 Path", $Image4_added) OpenEditBox() Global $Image4_Description = $editBox_save $Image4_done = 1 If $im4 = 0 Then Global $ImageCount += 1 $im4 = 1 EndIf Else EndIf Case $Image5 If $Image4_done = 1 Then ;GUICtrlSetState($Image5, 4+128) GUICtrlSetState($Image6, 64) OpenImages() Global $Image5_added = $imagePath ;MsgBox("Info", "Image 5 Path", $Image5_added) OpenEditBox() Global $Image5_Description = $editBox_save $Image5_done = 1 If $im5 = 0 Then Global $ImageCount += 1 $im5 = 1 EndIf Else EndIf Case $Image6 If $Image1_done = 1 Then ;GUICtrlSetState($Image6, 4+128) OpenImages() Global $Image6_added = $imagePath ;MsgBox("Info", "Image 6 Path", $Image6_added) OpenEditBox() Global $Image6_Description = $editBox_save If $im6 = 0 Then Global $ImageCount += 1 $im6 = 1 EndIf Else EndIf  
    • Armand
      By Armand
      Hi,
      I've attached an example picture of a shape which i would like to calculate it's area. Let's say a user has marked this kind of shaped area on the screen and you need to run some calculations on it, like getting the area of it.
      - How would you go about this problem?
      Thanks in advance