rajah Posted May 5, 2015 Share Posted May 5, 2015 hellofirst sorry about my bad englishi'm working on a little project a couple weeks ago, and i'm stuck on a little problemi'm noob in autoit soi hope that i can found a solution herethis is my code#include <ScreenCapture.au3> #include <FTPEx.au3> $iQuality = 30 $slp = 5000 $random = Random (1,987654,1) ; generate a random file name $host = "host.something.com" $user = "username" $pass = "mypassword" $public = "" $folder = "livestream/images/" $open = _FTP_Open("MySQL Upload") $conn = _FTP_Connect($open, $host, $user, $pass, 0, 21) $select1 = @ScriptDir &"/" &$random&".jpg" While 1 _ScreenCapture_SetJPGQuality ( $iQuality ) _ScreenCapture_Capture (@ScriptDir &"/" &$random&".jpg") _FTP_FilePut($conn, $select1, $public & $folder & $random & ".jpg") Sleep ($slp) _FTP_FileDelete ($conn, $folder & $random & ".jpg" ) FileDelete ( @ScriptDir &"\" &$random&".jpg") WEnd a simple code, i call it a live streamingso, i can navigate to www.site.com/streaming.php and keep watching the images progress.the problem here is i can't resize the pictures, and i have a big screen, so each frame is about 950kbso the stream is extremly laggy !even when i reduce the quality of the capture, i can't make it smallerthe question ishow can i resize images? i dont care if i lost the quality.THANKS I love to program, and if I ever lose that love, I will no longer be a programmer. It will be a sad day. Link to comment Share on other sites More sharing options...
mikell Posted May 5, 2015 Share Posted May 5, 2015 Have a look in the helpfile to _GDIPlus_ImageResize() and _GDIPlus_ImageSaveToFile() rajah 1 Link to comment Share on other sites More sharing options...
rajah Posted May 7, 2015 Author Share Posted May 7, 2015 already donecan't understand anything ... i'm noob bro, that code up there took me about 1 month loland i can't find the easy way to do itwhy not _ScreenCapture_SetReolution or something like that ? I love to program, and if I ever lose that love, I will no longer be a programmer. It will be a sad day. Link to comment Share on other sites More sharing options...
jguinch Posted May 7, 2015 Share Posted May 7, 2015 The example for _GDIPlus_ImageGetWidth in the helpfile does exatly what you want. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2015 Moderators Share Posted May 7, 2015 rajah,You have been reported for sending PMs asking for help. Please read the Forum rules when you log back into the forum - you will see that we do not permit that here.Asking for help via PM is discouraged because the forum is here to help everyone - if you get private help then no-one else can benefit.So please do not do it again - just post in the forum and someone will help you.M23 rajah 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
mikell Posted May 7, 2015 Share Posted May 7, 2015 Here is a simple example of resizing an image and save it to file#include <ScreenCapture.au3> $iQuality = 30 $random = Random (1,987654,1) ; generate a random file name Local Const $iW = @DesktopWidth, $iH = @DesktopHeight _ScreenCapture_SetJPGQuality($iQuality) $hCapture = _ScreenCapture_Capture() _GDIPlus_Startup() $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hCapture) $hImage2 = _GDIPlus_ImageResize($hImage1, $iW / 2, $iH / 2) _GDIPlus_ImageSaveToFile($hImage2, @ScriptDir &"/" &$random&".jpg") _WinAPI_DeleteObject($hCapture) _GDIPlus_ImageDispose($hImage1) _GDIPlus_ImageDispose($hImage2) _GDIPlus_Shutdown() Link to comment Share on other sites More sharing options...
rajah Posted May 7, 2015 Author Share Posted May 7, 2015 (edited) Melba23 Sorry bro, i will read the rules right now mikellthanks bro, that was a great solutionthat's exactly what i was looking for +1 Edited May 8, 2015 by rajah small mistake I love to program, and if I ever lose that love, I will no longer be a programmer. It will be a sad day. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now