Jump to content

tidy code before posting in forum?


gcue
 Share

Recommended Posts

hello world,

i have been noticing lately - wasn't the case before i don't think..

where i tidy my code before posting it with autoit tags

If $always_on_top = "True" Then
    $GUI = GUICreate($script_version, 320, 310, $x_position, $y_position, $GUI_SS_DEFAULT_GUI, $WS_EX_TOPMOST)
Else
    $GUI = GUICreate($script_version, 320, 310, $x_position, $y_position, $GUI_SS_DEFAULT_GUI)
EndIf
but the spacing is thrown off when i post, anyway around this?

thanks!

Edited by gcue
Link to comment
Share on other sites

hmm looks to be working now - weeeeird

test....

While 1
;1st camera
$bRecvtmp_A = TCPRecv($iSocket_A, 4096, 1) ;4kb

If @error = 0 And BinaryLen($bRecvtmp_A) > 0 Then
$bStream_A &= $bRecvtmp_A

If $iImgLen_A = 0 Then
$sStream_A = BinaryToString($bStream_A)

$iContLenPos_A = StringInStr($sStream_A, "Content-Length: ", 2)
$iEOH_A = StringInStr($sStream_A, @CRLF & @CRLF, 2, 1, $iContLenPos_A)

If $iEOH_A > 0 And $iContLenPos_A > 0 Then
$sTrim2ContLen_A = StringTrimLeft($sStream_A, $iContLenPos_A + $iContLengthLen_A - 1)

$iImgLen_A = Number(StringLeft($sTrim2ContLen_A, StringInStr($sTrim2ContLen_A, @CR, 2) - 1))

$bStream_A = BinaryMid($bStream_A, $iEOH_A + 4)
EndIf
EndIf

If $iImgLen_A > 0 Then
$iStreamLen_A = BinaryLen($bStream_A)
If $iStreamLen_A >= $iImgLen_A Then
If Not $blGUIMinimized Then
$hBMP_A = Load_BMP_From_Mem($bStream_A)

$hHBITMAP2_A = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBMP_A)

_WinAPI_DeleteObject(_SendMessage($hPic_A, $STM_SETIMAGE, 0, $hHBITMAP2_A))

_GDIPlus_ImageDispose($hBMP_A)
_WinAPI_DeleteObject($hHBITMAP2_A)
EndIf

$iImgLen_A = 0
EndIf
EndIf
EndIf

;2nd camera
$bRecvtmp_B = TCPRecv($iSocket_B, 4096, 1) ;4kb

If @error = 0 And BinaryLen($bRecvtmp_ B) > 0 Then
$bStream_B &= $bRecvtmp_B

If $iImgLen_B = 0 Then
$sStream_B = BinaryToString($bStream_ B)

$iContLenPos_B = StringInStr($sStream_B, "Content-Length: ", 2)
$iEOH_B = StringInStr($sStream_B, @CRLF & @CRLF, 2, 1, $iContLenPos_ B)

If $iEOH_B > 0 And $iContLenPos_B > 0 Then
$sTrim2ContLen_B = StringTrimLeft($sStream_B, $iContLenPos_B + $iContLengthLen_B - 1)

$iImgLen_B = Number(StringLeft($sTrim2ContLen_B, StringInStr($sTrim2ContLen_B, @CR, 2) - 1))

$bStream_B = BinaryMid($bStream_B, $iEOH_B + 4)
EndIf
EndIf

If $iImgLen_B > 0 Then
$iStreamLen_B = BinaryLen($bStream_ B)
If $iStreamLen_B >= $iImgLen_B Then
If Not $blGUIMinimized Then
$hBMP_B = Load_BMP_From_Mem($bStream_ B)

$hHBITMAP2_B = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBMP_ B)

_WinAPI_DeleteObject(_SendMessage($hPic_B, $STM_SETIMAGE, 0, $hHBITMAP2_ B))

_GDIPlus_ImageDispose($hBMP_ B)
_WinAPI_DeleteObject($hHBITMAP2_ B)
EndIf

$iImgLen_B = 0
EndIf
EndIf
EndIf
WEnd
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...