Jump to content

Search the Community

Showing results for tags 'resize'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Member Title




Found 22 results

  1. Hi, For an internal project I want to write internal script to mail some special request to an external party. To make it a little bit universal I decided that the user should be able to write or edit the e-mail signature. Because I wanted to put a logo into the e-mail, I decided to use RichEdit. I I found the following code by @UEZ and adapted it a little to save and load. When I start the script and edit the text only, I can save and load the signature.rtf. However the moment I resize one of the images (with the mouse), the script wil only save the edited image. Somehow resizing an image deletes the other content of the RichEdit object. Does anyone know a solution for me? P.s. you need to delete signature.rtf to reset the file. #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGui, $iMsg, $idBtnExit, $hRichEdit $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, StringLen(".exe")) & ")", 520, 550, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 500, 490, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) $idBtnExit = GUICtrlCreateButton("Exit", 10, 510, 40, 30) $GoodRead = False If FileExists(@ScriptDir & "\signature.rtf") Then $ResSFF = _GUICtrlRichEdit_StreamFromFile($hRichEdit, @ScriptDir & "\signature.rtf") If $ResSFF=true then $GoodRead = True EndIf If $GoodRead=False Then _GUICtrlRichEdit_InsertText($hRichEdit, "Inserting image..." & @LF & @LF) _GUICtrlRichEdit_InsertText($hRichEdit, @LF & "JPG image scaled:" & @LF & @LF) _GUICtrlRichEdit_InsertBitmap($hRichEdit, "c:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", "\qc", "\picw6747\pich1058\picwgoal6690\pichgoal1860\") ;\qc = centered _GUICtrlRichEdit_InsertText($hRichEdit, @LF & @LF & "PNG image:" & @LF & @LF) _GUICtrlRichEdit_InsertBitmap($hRichEdit, "c:\Program Files (x86)\AutoIt3\Examples\GUI\Torus.png") _GUICtrlRichEdit_InsertText($hRichEdit, @LF & @LF & "Done.") EndIf GUISetState(@SW_SHOW) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idBtnExit _GUICtrlRichEdit_StreamToFile($hRichEdit, @ScriptDir & "\signature.rtf") _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes GUIDelete() Exit EndSwitch WEnd EndFunc ;==>Example Func _GUICtrlRichEdit_InsertBitmap($hWnd, $sFile, $sFormatFunctions = "\", $sBitmapFunctions = "\", $iBgColor = Default) ;coded by UEZ build 2016-02-16 If Not FileExists($sFile) Then Return SetError(0, 0, 1) If Not _WinAPI_IsClassName($hWnd, $__g_sRTFClassName) Then Return SetError(0, 0, 2) _GDIPlus_Startup() Local $hImage = _GDIPlus_ImageLoadFromFile($sFile) If @error Then _GDIPlus_Shutdown() Return SetError(0, 0, 3) EndIf Local Const $aDim = _GDIPlus_ImageGetDimension($hImage) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($aDim[0], $aDim[1]), $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap) If $iBgColor = Default Then $iBgColor = 0xFF000000 + _WinAPI_SwitchColor(_GUICtrlRichEdit_GetBkColor($hWnd)) EndIf _GDIPlus_GraphicsClear($hGfx, $iBgColor) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage, 0, 0, $aDim[0], $aDim[1]) _GDIPlus_GraphicsDispose($hGfx) Local $binStream = _GDIPlus_StreamImage2BinaryString($hBitmap, "BMP") If @error Then _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hBitmap) _GDIPlus_Shutdown() Return SetError(0, 0, 4) EndIf Local $binBmp = StringMid($binStream, 31) Local Const $binRtf = "{\rtf1\viewkind4" & $sFormatFunctions & " {\pict{\*\picprop}" & $sBitmapFunctions & "dibitmap " & $binBmp & "}\par}" ;check out http://www.biblioscape.com/rtf15_spec.htm _GUICtrlRichEdit_AppendText($hWnd, $binRtf) $binStream = 0 $binBmp = 0 _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hBitmap) _GDIPlus_Shutdown() Return 1 EndFunc ;==>_GUICtrlRichEdit_InsertBitmap Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "JPG", $iQuality = 80, $bSave = False, $sFileName = @ScriptDir & "\Converted.jpg") ;coded by UEZ 2013 build 2014-01-25 (based on the code by Andreik) Local $sImgCLSID, $tGUID, $tParams, $tData Switch $sFormat Case "JPG" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 Local $pData = DllStructGetPtr($tData) $tParams = _GDIPlus_ParamInit(1) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Case "PNG", "BMP", "GIF", "TIF" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Case Else Return SetError(1, 0, 0) EndSwitch Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx If @error Then Return SetError(2, 0, 0) _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams)) If @error Then Return SetError(3, 0, 0) Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx If @error Then Return SetError(4, 0, 0) Local $iMemSize = _MemGlobalSize($hMemory) If Not $iMemSize Then Return SetError(5, 0, 0) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx _MemGlobalFree($hMemory) If $bSave Then Local $hFile = FileOpen($sFileName, 18) If @error Then Return SetError(6, 0, $bData) FileWrite($hFile, $bData) FileClose($hFile) EndIf Return $bData EndFunc ;==>_GDIPlus_StreamImage2BinaryString
  2. Hi, I am having a problem properly saving the Width of a resizable Gui. When a user resizes the Gui it gets saved in an ini when the Gui closes to then restore the new Width upon reopening the app. with GUICreate("myGui",300,200,Default,Default,$WS_SIZEBOX) WinGetPos($hGUI) returns 314, and WinGetClientSize($hGUI) returns 298 when its then saved in the ini the gui keeps expanding or shrinking every time its opened by +14 or -2 I figure it has to do with borders etc, but i also guess borders depend on the window theme and whatnot or is user specific, so i can't just do $GuiWidth = $GetGuiWidth[arr] -14 or +2 right? is there a proper way of doing this? Thanks in advance, Aapjuh
  3. #include <GUIConstants.au3> #include <WindowsConstants.au3> Local $oPlayer, $gVideo, $width, $height $oPlayer = ObjCreate("WMPlayer.OCX.7") $oPlayer.URL = 'http://www.clubbalcony.com/upload/culture/yong(2).wmv' Local $srcFound = True Local $time1 = TimerInit() While 1 If $oPlayer.playState() = 3 Then $width = $oPlayer.currentMedia.imageSourceWidth $height = $oPlayer.currentMedia.imageSourceHeight ExitLoop EndIf If TimerDiff($time1) > 5000 Then $srcFound = False ExitLoop EndIf Sleep(50) WEnd If Not $srcFound Or $width = 0 Then $oPlayer.Close() Exit Else $gVideo = GUICreate("Video Control", $width, $height+63, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX), $WS_EX_TOPMOST) GUICtrlCreateObj($oPlayer, 0, 0, $width, $height+63) $oPlayer.uiMode = "Full" $oPlayer.stretchToFit = True GUISetState(@SW_SHOW, $gVideo) EndIf While 1 $Msg = GUIGetMsg(1) Switch $Msg[0] Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_RESIZED ;This is where I want to resize the video image to fit the new window size EndSwitch WEnd $oPlayer.Close() How should I code the $GUI_EVENT_RESIZED portion to resize the video to fit the resized window? Your help will be greatly appreciated.
  4. Here a small tool to watermark any image supported by GDI+. This version is the enhanced version from AutoIt Windows Screenshooter. Screenshot: Download: AutoIt Watermark Image v0.89 beta build 2014-08-25.7z (942 download previously) Source code is too long to publish here -> PASTEBIN You are not allowed to sell this code or use it or just parts of it in a commercial project or modify it and distribute it with a different name! Some fonts may no be displayed properly because it is not GDI+ compatible! Appreciate any feedback (bugs, feature request, criticisms, etc.). @JScript: I created this on your request Coded and tested on Win7 x64 with Aero and AutoIt v3.3.12.0. Command line parameters Credits: Authenticity (GDIP.au3), funkey (_GetFontInfoFromFilePtr()), Yashied (WinAPIEx.au3) and Melba23 (NoFocusLines.au3) Thanks to (alph. order): davidkim, funkey, JScript and Myicq for active supporting this little project! Br, UEZ History
  5. I need to dynamically resize my 2d array while looping. I know this code: ReDim $rArray[UBound($rArray) + 1] works for the rows, however, I also need to increase the columns. How would i go about increasing both rows and columns while looping?
  6. Is there a (simple) way to make your script using a picture-control to resize the gui? This would be useful for a transparant pop-up window with a custom made theme using picture controls: $Form = GUICreate('', 301, 173, 5, 5, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUICtrlCreatePic(@scriptdir & "\resize_win.bmp", 0, 73, 20, 51) ; some api call or code telling the os to use this picture as a resize border GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUISetState(@SW_SHOW) While True if GUIGetMsg() = $GUI_EVENT_CLOSE then Exit WEnd EDIT: to make it more clear what i wanna do, if you go with the mouse arrow over the border of a re-sizable window the arrow changes to a "resize" arrow, you click and drag the border and then the window size adjusts to the mouse position until you release the mouse button. I want my picture control to be used the same way as the resize border to resize my window.
  7. I'm trying to create a simple clock widget that automatically scales the text to the size of the window. I came up with the following method, but it doesn't work as well as I'd like. It especially has trouble scaling to the width of the window for some reason (in the example, try resizing the window to be narrow and tall). Does anyone have a better method? #include <Misc.au3> #include <WinAPIConv.au3> #include <GUIConstants.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Global $_FONT_FAMILY = 'Arial', $_LB_TEXT Main() Func Main() _GDIPlus_Startup() Local $hGUI GUIRegisterMsg($WM_SIZE, WM_SIZE) $hGUI = GUICreate('', 300, 100, Default, Default, $WS_OVERLAPPEDWINDOW, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) $_LB_TEXT = GUICtrlCreateLabel('This is a string', 0, 0, 300, 100, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont($_LB_TEXT, _MeasureString($hGUI, GUICtrlRead($_LB_TEXT), $_FONT_FAMILY), 0, 0, $_FONT_FAMILY, 5) GUISetState() Local $iGM While 1 $iGM = GUIGetMsg() Switch $iGM Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _GDIPlus_Shutdown() EndFunc Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) GUICtrlSetFont($_LB_TEXT, _MeasureString($hWnd, GUICtrlRead($_LB_TEXT), $_FONT_FAMILY), 0, 0, $_FONT_FAMILY, 5) EndFunc Func _MeasureString($hWnd, $sString, $sFont = 'Arial') Local $iError, $aSize, $hGraphic, $hFormat, $hFamily, $tLayout, $iFontSize, $hFont, $aInfo If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) EndIf $aSize = WinGetClientSize($hWnd) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate($sFont) $tLayout = _GDIPlus_RectFCreate(0, 0, $aSize[0], $aSize[1]) $iFontSize = 0 Do If Not $hFamily Then $iError = 1 $iFontSize = 10 ExitLoop EndIf $iFontSize += 1 $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize, 0) $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat) _GDIPlus_FontDispose($hFont) If $aInfo[1] = 0 Then ExitLoop Until DllStructGetData($aInfo[0], 3) >= $aSize[0] Or DllStructGetData($aInfo[0], 4) >= $aSize[1] $iFontSize -= 1 _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphic) Return SetError($iError, 0, $iFontSize) EndFunc
  8. Hello, Do you have any idea to resize Vector graphic using some maths trick? It's example to create Vector image 10x10px and write A Local $a10x10 = [ _ 1,1,1,1,1,1,1,1,1,1, _ 1,1,1,0,0,0,0,1,1,1, _ 1,1,0,0,1,1,0,0,1,1, _ 1,1,0,1,1,1,1,0,1,1, _ 1,1,0,1,1,1,1,0,1,1, _ 1,1,0,0,0,0,0,0,1,1, _ 1,1,0,1,1,1,1,0,1,1, _ 1,1,0,1,1,1,1,0,1,1, _ 1,0,0,0,1,1,0,0,0,1, _ 1,1,1,1,1,1,1,1,1,1 _ ] Local $oVector = ObjCreate("WIA.Vector.1") If Not IsObj($oVector) Then ConsoleWrite("+++ Error " & @error & " durning create a Vector.object." & @CRLF) Exit EndIf Local $iBlue = 0xFF0000FF ; ARGB color Local $iWhite = 0xFFFFFFFF ; adding pixels to vector For $i = 0 To UBound($a10x10) - 1 Local $iPixel = $a10x10[$i] Local $iColor = $iBlue If $iPixel = 0 Then $iColor = $iWhite $oVector.Add($iColor) Next ; create a img 10x10 px Local $oImg = $oVector.ImageFile(10, 10) ; path to file Local $sPath = @ScriptDir & "\Vector.bmp" ; delete previous file if exits. FileDelete($sPath) ; save img to script direction. $oImg.SaveFile($sPath) ; show result, you have to use 800% size to see effects. ShellExecute("Vector.bmp")
  9. As the title says, I'm trying to show a thumbnail in a gui, selected by the user, which must be resized to fit the Gui Control and store the image itself in SQLite as a blob. Thanks to some useful examples found on the forum, I managed to load, show and store an image but I'm experiencing some problems in resizing the picture. This is what i made until now: #include <SQLite.au3> #include <SQLite.dll.au3> #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Local $hGUI, $hBMP, $hBitmap, $hGraphic Local $hQuery, $item Local $filename Local $x = 100, $y = 100 _SQLite_Startup() _SQLite_Open() ; open Database in Memory If @error Then MsgBox(16, "SQLite Error", "Can't Load Database!") Exit -1 EndIf _SQLite_Exec(-1,"CREATE TABLE IF NOT EXISTS DBTest (IMAGE BLOB);") $hGUI = GUICreate("GUI", 400, 300) $GUIImage = GUICtrlCreatePic("", 10, 10, $x, $y, BitOR($GUI_SS_DEFAULT_PIC,$SS_CENTERIMAGE,$SS_SUNKEN,$WS_BORDER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUISetState() GUISetState(@SW_SHOW) Local $filename = FileOpenDialog("Select image",@ScriptDir,"Image (*.jpg;*.bmp)",3) ; I could show the image in the gui here: ; GUICtrlSetImage($GUIImage,$ImageFileName) ; But I want to resize it, store it in a DB, then show the resized image in the GUI ; This is what I am trying to do for resize (taken from an example made by UEZ): _GDIPlus_Startup() Local $hImageFromFile = _GDIPlus_ImageLoadFromFile($filename) Local $Thumbnail = DllCall($ghGDIPDll, "uint", "GdipGetImageThumbnail", "handle", $hImageFromFile, "uint", $x, "uint", $y, "int*", 0, "ptr", 0, "ptr", 0) $Thumbnail = $Thumbnail[4] $object_bitmap = _GDIPlus_BitmapCreateFromHBITMAP($Thumbnail); Create a Bitmap object from a bitmap handle (?) _GDIPlus_Shutdown() ;********** How could I show the resized pic in the GUI? Dunno :( ***** ;preparing resized image for storing in SQLite Local $binary_bitmap = Binary($object_bitmap) Local $encoded_bitmap = _SQLite_FastEncode($binary_bitmap) ;insert the blob If Not _SQLite_Exec(-1, "SELECT IMAGE FROM DBTest") = $SQLITE_OK Then MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) If Not _SQLite_Exec(-1, "INSERT INTO DBTest (IMAGE) VALUES (" & $encoded_bitmap & ");") = $SQLITE_OK Then MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) ;Retrieve from database If Not _SQLite_Query(-1, "SELECT * FROM DBTest;", $hQuery) = $SQLITE_OK Then MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) If Not _SQLite_FetchData($hQuery, $item, False, False) = $SQLITE_OK Then MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) Local $retrieve_pic = $item[0] ;NOW *I THINK* I SHOULD HAVE THE RESIZED PICTURE IN $retrieve_pic BUT I CAN'T SHOW IT IN THE GUI..... ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd _SQLite_Close() _SQLite_Shutdown() Exit I'm not very good at GDI coding and quite a newbie with SQLite, too... Any help would be very appreciated!
  10. Hi guys, I have a GUI which requires scrolling, however resizing is a bit of a problem because any time you scroll down/up and then resize, the controls move down/up and blank space is created within the scrollable area. Any help with maintaining scrollable area size to be fixed would be great. Here is a reproducer: To achieve the undesirable effect I described, simply run the script, scroll down and then resize window. You will notice that new blank space is created either on top or on bottom of the window depending on scrolling/resizing direction. Easiest way to see how bad it is, is to scroll down the page about half-way and then maximise the window. You will notice now a whole bunch of blank space is added to the top of the window and scrolling up simply shows nothing, scrolling down shows controls but they are cut off because of the blank space created on top of the page. This is all happening within the yellow bg child gui. I need to make it so that even if the GUI is resized the contents of the yellow bg child gui do not move and the scrollable area within the child gui remains the same. #NoTrayIcon #include-once #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIScroll.au3> #include <SendMessage.au3> Opt("GUIResizeMode", 802) Global $parentgui_w = 880, $parentgui_h = 810, $childgui_w = $parentgui_w - 2, $childgui_h = $parentgui_h - 292 $parentgui = GUICreate("Scrollbar resize problem", $parentgui_w, $parentgui_h, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetBkColor(0xFFFFFF, $parentgui) $childgui = GUICreate("", $childgui_w, $childgui_h, -5, 263, $WS_POPUP, $WS_EX_MDICHILD, $parentgui) GUISetBkColor(0xFFF123, $childgui) Dim $buttons[25] For $i = 0 to 24 If $i > 0 Then $cPos = ControlGetPos($childgui, "", $buttons[$i - 1]) $buttons[$i] = GUICtrlCreateButton("Button " & $i + 1, ($childgui_w - 200) / 2, $cPos[1] + $cPos[3] + 50, 200, 80) Else $buttons[$i] = GUICtrlCreateButton("Button " & $i + 1, ($childgui_w - 200) / 2, 20, 200, 80) EndIf Next Scrollbar_Create($childgui, $SB_VERT, 130 * 25) Scrollbar_Step(15, $childgui, $SB_VERT) GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUIRegisterMsg($WM_NCACTIVATE, "WM_NCACTIVATE") GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL") GUISetState(@SW_SHOW, $parentgui) GUISetState(@SW_SHOWNOACTIVATE, $childgui) While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $parentgui Switch $msg[0] Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_RESTORE $pPos = WinGetPos($parentgui) WinMove($parentgui, "", Default, Default, $pPos[2]+1, $pPos[3]+1) WinMove($parentgui, "", Default, Default, $pPos[2]-1, $pPos[3]-1) EndSwitch EndSwitch WEnd Func WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) Local $iMw = BitShift($wParam, 16) $scroll_lines = 5 If $iMw > 0 Then For $i = 0 to $scroll_lines _SendMessage($childgui, $WM_VSCROLL, $SB_LINEUP) Next Else For $i = 0 to $scroll_lines _SendMessage($childgui, $WM_VSCROLL, $SB_LINEDOWN) Next EndIf Return $GUI_RUNDEFMSG EndFunc Func WM_SIZE($hwnd, $uMsg, $wParam, $lParam) If $hwnd = $parentgui Then $wPos = WinGetPos($parentgui) $pgui_wdiff = ($wPos[2] - $parentgui_w) / 2 $pgui_hdiff = ($wPos[3] - $parentgui_h) / 2 If $pgui_wdiff > 7 Then If $pgui_hdiff <> 0 Then If $wPos[2] > $parentgui_w Then WinMove($childgui, "", $wPos[0] + 2 + $pgui_wdiff, Default, $parentgui_w - 2, $wPos[3] - 306) Else WinMove($childgui, "", $wPos[0] + 2 + $pgui_wdiff, Default, $wPos[2] - 16, $wPos[3] - 306) EndIf Else WinMove($childgui, "", $wPos[0] + 2 + $pgui_wdiff, Default) EndIf ElseIf $pgui_wdiff < 7 Then If $wPos[0] <> -32000 Then WinMove($childgui, "", $wPos[0] + 8, Default, $wPos[2] - 16, $wPos[3] - 306) EndIf ElseIf $pgui_hdiff > 42 Then WinMove($childgui, "", Default, Default, Default, $wPos[3] - 306) EndIf EndIf Return 0 EndFunc Func WM_NCACTIVATE($hwnd, $imsg, $wparam) If $hwnd = $parentgui Then If NOT $wparam Then Return 1 EndIf Return $gui_rundefmsg EndFunc
  11. wakillon




    Capture Picture or window with Mouse Drag and upload it to 10 differents pic hosters. Or drop an Image on the little Frog for upload it directly ! for more details see :
  12. TinyPicSharer : A simple and handy tool for capture window or picture by mouse grab and an uploader for 10 Pic Hosters ! You can also Resize, Convert, Optimize, add WaterMark to your images easily. (optimization with jpegtran.exe, optipng.exe, gifsicle.exe command line tools) In plus it can extract images from Docs (pdf, doc, docx, odt, odp, ppt, pptx, pps, ppsx) (Doc extraction with b2xtranslator and pdfextract.exe command line tools) Just Drag'n drop a picture/doc on the Host Logo for load it. I have replaced Curl by WinHttp functions and TrIDLib.DLL by my own FileGetType function. Previous downloads : 1343 Update of 8 June 2013 source and executable are available in the Download Section See Tray menu for options. Double click on his tray icon for restore the gui. >zlib.au3, WinHttp.au3, >WinAPIEx UDF are needed. ( Thanks to Ward, trancexx, Yashield ) Hope you 'll find it usefull !
  13. Hi peeps, are you able to please help me out with reducing/eliminating the flicker when the GUI is being resized? The example is attached. Reason for zip is that I'm using a couple of UDFs (namely: Ribbon bar and ModernMenuRaw so I've included them in the attached archive). Source here: #Region ### includes ### #include-once #NoTrayIcon #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Ribbonsbar.au3> #include <GuiListView.au3> #include <EditConstants.au3> #EndRegion ### includes ### Opt("GUIResizeMode", 802) Global $appname = 'Example App', $appver = '1.0', $additemsgui_W = 400, $additemsgui_H = 150 #Region ### $maingui ### $maingui = GUICreate($appname & ' ' & $appver, @DesktopWidth, 600, -1, -1, BitOr($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) $hBar = _RibbonsBar_Create($maingui, 0, 0, 0, 0, 'blue') $hTab_Home = _RibbonsBar_Create_Tab($hBar, 'Home') $hItem_FileOps = _RibbonsBar_Create_TabItem($hTab_Home, 'File operations' , 225 ) $hGrandButton_New = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',412,'New',52, True ) _RibbonsBar_GrandButtons_Enable($hGrandButton_New, 0) $hDropDownNew = _RibbonsBar_Create_ContextMenu($hGrandButton_New) $hDropDownNew_1 = _GUICtrlCreateODMenuItem("Standard ...", $hDropDownNew, "smallIcons.dll", 261) $hDropDownNew_2 = _GUICtrlCreateODMenuItem("Manual ...", $hDropDownNew, "smallIcons.dll", 382) $hGrandButton_Open = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',453,'Open',52, False ) _RibbonsBar_GrandButtons_Enable($hGrandButton_Open, 0) $hGrandButton_Save = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',514,'Save',52, True ) _RibbonsBar_GrandButtons_Enable($hGrandButton_Save, 0) $hDropDownSave = _RibbonsBar_Create_ContextMenu($hGrandButton_Save) $hDropDownSave_1 = _GUICtrlCreateODMenuItem("Save", $hDropDownSave, "smallIcons.dll", 287) $hDropDownSave_2 = _GUICtrlCreateODMenuItem("Save As ...", $hDropDownSave, "smallIcons.dll", 286) $hGrandButton_Export = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',337,'Export',62, True ) _RibbonsBar_GrandButtons_Enable($hGrandButton_Export, 0) $hDropDownExport = _RibbonsBar_Create_ContextMenu($hGrandButton_Export) $hDropDownExport_1 = _GUICtrlCreateODMenuItem("To Excel", $hDropDownExport, "smallIcons.dll", 1243) $hItem_ItemOps = _RibbonsBar_Create_TabItem ( $hTab_Home, 'Item operations' , 393 ) $hGrandButton_AddItems = _RibbonsBar_Create_GrandButton($hItem_ItemOps,'',301,'Add item(s)',72, True ) $hDropDownAddItems = _RibbonsBar_Create_ContextMenu($hGrandButton_AddItems) _RibbonsBar_GrandButtons_Enable($hGrandButton_AddItems, 0) $hDropDownAddItems_1 = _GUICtrlCreateODMenuItem("From Catalogue", $hDropDownAddItems, "smallIcons.dll", 173) $hDropDownAddItems_2 = _GUICtrlCreateODMenuItem("From Quote", $hDropDownAddItems, "smallIcons.dll", 143) $hDropDownAddItems_3 = _GUICtrlCreateODMenuItem("Paste", $hDropDownAddItems, "smallIcons.dll", 9) $hGrandButton_DelItems = _RibbonsBar_Create_GrandButton($hItem_ItemOps,'',615,'Delete item(s)',82, False ) _RibbonsBar_GrandButtons_Enable($hGrandButton_DelItems, 0) $SmallButton_Undo = _RibbonsBar_Create_SmallButton($hItem_ItemOps,'',728,1,'Undo (Test: click to enable grand buttons)',230) $SmallButton_Redo = _RibbonsBar_Create_SmallButton($hItem_ItemOps,'',194,2,'Redo (Test: click to disable grand buttons)',230) _RibbonsBar_SmallButtons_Enable($SmallButton_Redo, 0) $hTab_Help = _RibbonsBar_Create_Tab( $hBar, 'Help' ) $hItem_Information = _RibbonsBar_Create_TabItem ( $hTab_Help, 'Information' , 120 ) $hGrandButton_About = _RibbonsBar_Create_GrandButton($hItem_Information,'',631,'Help','',False) $hGrandButton_About = _RibbonsBar_Create_GrandButton($hItem_Information,'',644,'About','',False) _RibbonsBar_Tab_SetState($hTab_Home) GUISwitch($maingui) WinMove($maingui, "", Default, Default, 800, Default) $wPos = WinGetPos($maingui) WinMove($maingui, "", @DesktopWidth/2 - $wPos[2]/2, @DesktopHeight/2 - $wPos[3]/2, Default, Default) $wPos = WinGetPos($maingui) $mainlistview = GUICtrlCreateListView('Col 1|Col 2|Col 3|Col 4|Col 5|Col 6', -2, 120, _ $wPos[2], $wPos[3], Default) _GUICtrlListView_SetExtendedListViewStyle($mainlistview, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_FLATSB)) _GUICtrlListView_SetColumnWidth($mainlistview, 0, 120) _GUICtrlListView_SetColumnWidth($mainlistview, 1, 250) _GUICtrlListView_SetColumnWidth($mainlistview, 2, 50) _GUICtrlListView_SetColumnWidth($mainlistview, 3, 100) _GUICtrlListView_SetColumnWidth($mainlistview, 4, 100) _GUICtrlListView_SetColumnWidth($mainlistview, 5, 50) #EndRegion ### $additemsgui ### #Region ### $additemsgui ### $additemsgui = GUICreate('Add item(s) from Catalogue', $additemsgui_W, $additemsgui_H, 0, 0, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX), $WS_EX_MDICHILD, $maingui) GUISetBkColor(0xf2f8ff) GUISetFont(10, 400) $additems_addlabel = GUICtrlCreateLabel('Start typing below to add item(s) from catalogue (min 2 chars):', 10, 15, $additemsgui_W - 20, 21) $additemsinput = GUICtrlCreateInput('', 10, 45, $additemsgui_W - 20, Default) GUICtrlSendMsg(-1, $EM_SETCUEBANNER, False, 'Enter an item number here') $additemsbn_add = GUICtrlCreateButton('Add', 10, 85, 110, 40) #EndRegion ### $additemsgui ### GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") ; Register WM_GETMINMAXINFO GUISetState(@SW_SHOW, $maingui) GUICtrlSetResizing($mainlistview, BitOR($GUI_DOCKLEFT, $GUI_DOCKRIGHT, $GUI_DOCKTOP)) While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $maingui Switch $msg[0] Case $GUI_EVENT_CLOSE Exit Case $hDropDownAddItems_1 GUISetState(@SW_DISABLE, $maingui) $mPos = WinGetPos($maingui) WinMove($additemsgui, '', $mPos[0] + (($mPos[2]/2) - ($additemsgui_W/2)), $mPos[1] + (($mPos[3]/2) - ($additemsgui_H/2))) GUICtrlSetData($additemsinput, '') GUISetState(@SW_SHOW, $additemsgui) _WinAPI_SetFocus(ControlGetHandle('', '', $additems_addlabel)) Case $hDropDownNew_1 ConsoleWrite('Clicked "New" menu item 1'&@CRLF) Case $hDropDownNew_2 ConsoleWrite('Clicked "New" menu item 2'&@CRLF) EndSwitch Case $additemsgui Switch $msg[0] Case $GUI_EVENT_CLOSE GUISetState(@SW_ENABLE, $maingui) GUISetState(@SW_HIDE, $additemsgui) EndSwitch EndSwitch Switch _RibbonsBar_GetMsg() Case $hGrandButton_Open ConsoleWrite('open...'&@CRLF) Case $SmallButton_Undo _RibbonsBar_GrandButtons_Enable($hGrandButton_New, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_Save, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_Export, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_AddItems, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_DelItems, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_Open, 1) If _RibbonsBar_SmallButtons_GetState($SmallButton_Undo) = 1 Then ConsoleWrite('undo...'&@CRLF) EndIf Case $SmallButton_Redo _RibbonsBar_GrandButtons_Enable($hGrandButton_New, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_Save, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_Export, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_AddItems, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_DelItems, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_Open, 0) If _RibbonsBar_SmallButtons_GetState($SmallButton_Redo) = 1 Then ConsoleWrite('redo...'&@CRLF) EndIf Case $hTab_Home _RibbonsBar_Tab_SetState($hTab_Home) Case $hGrandButton_Export _RibbonsBar_ContextMenu_SetState($hDropDownExport) Case $hGrandButton_Save _RibbonsBar_ContextMenu_SetState($hDropDownSave) Case $hGrandButton_AddItems _RibbonsBar_ContextMenu_SetState($hDropDownAddItems) Case $hGrandButton_New _RibbonsBar_ContextMenu_SetState($hDropDownNew) Case $hTab_Help _RibbonsBar_Tab_SetState($hTab_Help) EndSwitch WEnd Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) If $hWnd = $maingui Then $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, 800) ; W (min size) DllStructSetData($tagMaxinfo, 8, 600) ; H (min size) Return 0 EndIf EndFunc ;==>WM_GETMINMAXINFO Thanks heaps in advance! example.zip
  14. This have nothing to do with GUI resizing ( when to resize the GUI, to resize the listview also ), instead I want to resize the items from the listview control, to appear much larger, much thicker ( also the text within them to be larger ). Is this possible ?
  15. WallpaperCropper Easily Crop a picture to a wanted Screen dimension and set your Windows desktop background wallpaper without stretching or distorting it. Does your desktop background picture look stretched ? Do you find it time-consuming to crop pictures to the right proportions for your desktop ? WallpaperCropper is the solution. Crop and set any picture easily to your desktop dimensions in some few clicks. Don't waste time loading big, slow photo-editing software to manually crop it or resize it. Don't stay stuck with the choices Windows gives you ! Drag'n drop a Picture for load it. Drag it for position it and use mouse wheel for zoom - unzoom it.(TouchPad users need to plug a Mouse ) Select dimensions and format you want for save your wallpaper. Pictures with transparency are supported. By default Pictures are saved on your desktop. Tips : Hold Left Ctrl key for move the photo more slowly. Hold Left Shift key for move the photo more quickly. Hold Left Shift key for Zoom/UnZoom more quickly. Hold Left Shift key when drag'n drop photo for work with a best quality. (Moves and Zoom are more slow) All externals files are included in script, and all Buttons were made online with chimply.com the easy and free buttons Generator ! Previous downloads : 70 source : WallpaperCropper executable : WallpaperCropper.exe.html (Once this html file downloaded, double click on it for start the download) Hope you will like it !
  16. Is it possible to resize a window without jsut making it bigger, but make the sides moving outwards / inwards to resize the window.
  17. I want to show an image on my gui, but my problem is that my image is 60 pixels high, but the gui where it should be shown is 600 pixels high. so the image is blurred and everything. Can I fix that somehow? Like in photoshop, change that it repeats the pixels instead of blurring it.
  18. Hi everyone I have a problem resizing a window when a other tab is selected, the problem is not in resizing it but to keep the windows in the same position here's a example: #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 386, 274) $Tab1 = GUICtrlCreateTab(0, 0, 385, 273) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") GUICtrlSetState(-1, $GUI_SHOW) $input1 = GUICtrlCreateInput("Click in here", 60, 34, 100, 22) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Tab1 $pos = WinGetCaretPos() If GUICtrlRead($Tab1) = 0 Then WinMove($Form1, "", $pos[0] - 3, $pos[1] - 25, 386, 274) GUICtrlSetPos($Tab1, -1, -1, 386, 274) ElseIf GUICtrlRead($Tab1) = 1 Then WinMove($Form1, "", $pos[0] - 3, $pos[1] - 25, 276, 300) GUICtrlSetPos($Tab1, -1, -1, 276, 300) EndIf EndSwitch WEnd As you can see/test, if you change tab without clicking in a control (input1) the window will be resized without moving, but if you click/input in a control it starts moving Any tips?
  19. So I'm making this gui with an embedded IE object. It all goes well until I add some functionality, one in particular and it's a big one, the window will be in the same place and same size as you left it when you last exited the program. No big deal until I found that when I resize the window programmatically the controls below the IE Object seemingly disappear. Look a little closer and I find that they're not invisible, just white. I messed around and found out that it has something to do with having the style $WS_CLIPCHILDREN on the gui. I take it off and the controls show up no problem, but then the whole IE object freezes so that's definitely not the solution I'm looking for. I've tried searching the forums, the internet, and the help file, but I can't find the answer to this evil problem. One thing I noticed was that if I resized the window just the slightest with the mouse all the controls would reappear, or if I hovered on them they parts of the control would reappear piece by piece. So I tried using some window redraw / repaint functions, I've tried several different winmove functions, and I even went so far as to try to emulate resizing the window through the mouse by using the _SendMessage function to send the individual WM_ENTERSIZEMOVE, WM_SIZING, WM_SIZE, and WM_EXITSIZEMOVE messages to the window, but to no avail. However if I set a certain size of window with the WM_SIZE message that wasn't the window size it would show up in the window with a bunch of whitespace because it wasn't taking up the whole window, but that isn't germane and I digress. If anyone knows any rerendering messages I could send the the window please post them here! I'm willing to try anything at the moment. I assume there's a message I'm missing in the resizing emulation since it isn't coming out right. Oh, another thing that would be helpful is if someone knew how to monitor all the messages going to my gui, instead of just specific individual messages defined by the GUIRegisterMsg function. Below is a far shortened example of my code along with the screen shot of it with a few citations. #include <IE.au3> #include <Array.au3> #include <WinAPI.au3> #include <Constants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $name = @UserName $opts = " |Me ("&$name&")" $oIE = _IECreateEmbedded() $Main = GUICreate("Example of Frustration", 795, 610, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME,$WS_CLIPCHILDREN)) $ObjectIE = GUICtrlCreateObj($oIE, 8, 8, 777, 561) GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKLEFT) GUICtrlCreateLabel("Follow", 8, 580, 34, 17, $WS_CLIPSIBLINGS) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $ComboFollow = GUICtrlCreateCombo("", 48, 578, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL,$WS_CLIPSIBLINGS)) $default = " " GUICtrlSetData(-1, $opts, $default) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $SliderOpacity = GUICtrlCreateSlider(280, 576, 150, 25) GUICtrlSetLimit(-1, 255, 55) GUICtrlSetData(-1, 255) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $ButtonFullscreen = GUICtrlCreateButton("Faux Fullscreen", 680, 576, 107, 25, $WS_CLIPSIBLINGS) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) _IENavigate($oIE, "http://google.com") GUISetState(@SW_SHOW) _WinAPI_MoveWindow($Main, 100, 100, 450, 350) While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd Thanks for your time! -Brian
  20. Hey guys, I have a column in a listview which is meant to be hidden but not deleted. The reason for this, is because the listview will hold values from an inisectionread and I dont want the names of the keys to appear. Is this possible? Thanks.
  21. Hi guys, With GUICreate, when set H and W, it start from bottom-right for resize the GUI. If i want to resize the four side starting from the center? So the four side it will be resize in the same way. Hope i was clear, if i wasn't i'll do some screen Thanks for support
  22. Hello everyone. I want to run a function when a GUI window is resized. However, when I click to resize the GUI, before I actually drag the corner of the GUI it runs and prevents me from resizing the GUI. I was hoping that I would be able to make this message run once the GUI has finished running. Would this be possible? Thanks Edit I have solved it. The answer: GUISetOnEvent($GUI_EVENT_RESIZED, 'WM_SIZE', $hWnd)
  • Create New...