JScript Posted July 23, 2012 Author Posted July 23, 2012 About CPU usage, it is only while the frames are being scaled, after which the CPU usage drops significantly! And about losing quality, it depends on how you're scaling the image... Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
asdf8 Posted July 23, 2012 Posted July 23, 2012 In code I have found scaling only for animation (in functions __grp_buildlist) - there scaling occurs on each frame (loads processor) and with poor quality. For a static image scaling is not found, images obtained with increasing very poor quality. All this can be easily verified.
JScript Posted July 23, 2012 Author Posted July 23, 2012 (edited) For a static image scaling is not found, images obtained with increasing very poor quality. Execute this example:#include <File.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; Local include. #include "_GUIResourcePic.au3" _Example() ; Example GUI Func _Example() Local $bUrlImage GUICreate("Show a simple image with no animation", 800, 600, 0, 0) $bUrlImage = InetRead("http://www.autoitscript.com/site/wp-content/themes/TheCorporation/images/logo.png") _GUICtrlPic_Create($bUrlImage, 0, 0, 0, 0) GUISetState() _GUICtrlPic_Create($bUrlImage, 50, 50, 300, 300, $GIS_ASPECTRATIOFIX) _GUICtrlPic_Create($bUrlImage, 120, 120, 400, 400, $GIS_ASPECTRATIOFIX) _GUICtrlPic_Create($bUrlImage, 230, 230, 300, 300, $GIS_ASPECTRATIOFIX) _GUICtrlPic_Create($bUrlImage, 320, 320, 0, 0, $GIS_ASPECTRATIOFIX) _GUICtrlPic_Create($bUrlImage, 390, 390, 100, 100, $GIS_ASPECTRATIOFIX) _GUICtrlPic_Create($bUrlImage, 430, 430, 50, 50, $GIS_ASPECTRATIOFIX) While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd EndFunc ;==>_ExampleThe quality of the resized image will depend solely on the image itself, is not it? In code I have found scaling only for animation (in functions __grp_buildlist) - there scaling occurs on each frame (loads processor) and with poor quality. The above code it proved otherwise? Do you have any idea how to improve the quality of images scaled and even reduce the CPU consumption while images being resized? João Carlos. Edited July 23, 2012 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
asdf8 Posted July 23, 2012 Posted July 23, 2012 (edited) The quality of the resized image will depend solely on the image itself, is not it? Try replacing in function _GUICtrlPic_Create : ; Check if gif is animated... Switch $iFrameCount Case 0 ; Shows the single frame in the control. __GRP_hImgToCtrl($iCtrlID, $hOImage, $pDimensionIDs, 0) to : ; Check if gif is animated... Switch $iFrameCount Case 0 ; Shows the single frame in the control. If ($iWidth > 0 And $iWidth <> $iOWidth) Or ($iHeight > 0 And $iHeight <> $iOHeight) Then Local $NewImage = __GDIPCreateBitmapFromScan0($iWidth, $iHeight, 0, $GDIP_PXF32ARGB, 0) Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($NewImage) DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGraphics, "int", 7) _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hOImage, 0, 0, $iOWidth, $iOHeight, 0, 0, $iWidth, $iHeight) _GDIPlus_ImageDispose($hOImage) _GDIPlus_GraphicsDispose($hGraphics) $hOImage = $NewImage EndIf __GRP_hImgToCtrl($iCtrlID, $hOImage, $pDimensionIDs, 0) and run a example. Do you have any idea how to improve the quality of images scaled and even reduce the CPU consumption while images being resized? In functions of the __grp_buildlist needed to change the size, only if there has been an event window $WM_SIZE Edited July 23, 2012 by asdf8
JScript Posted July 23, 2012 Author Posted July 23, 2012 Now it's perfect! Thanks! In functions of the __grp_buildlist needed to change the size, only if there has been an event window $WM_SIZE I disagree, if I want the animated GIF has different dimensions of the original without having to use the WM_SIZE event? João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
JScript Posted July 23, 2012 Author Posted July 23, 2012 (edited) @asdf8 The final code looks like this: ; Resize the picture with quality, thanks to the asdf8! ; http://www.autoitscript.com/forum/topic/100167-guiresourcepicau3-udf-supports-gif-animation-using-gdi/page__st__20#entry1004411 If $iReSize Then Local $hOBitmap = __GDIPCreateBitmapFromScan0($iWidth, $iHeight, 0, $GDIP_PXF32ARGB, 0) Local $hGraphic = _GDIPlus_ImageGetGraphicsContext($hOBitmap) DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGraphic, "int", 7) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hOImage, 0, 0, $iWidth, $iHeight) _GDIPlus_ImageDispose($hOImage) _GDIPlus_GraphicsDispose($hGraphic) $hOImage = $hOBitmap EndIf ; Shows the single frame in the control. __GRP_hImgToCtrl($iCtrlID, $hOImage, $pDimensionIDs, 0)Thanks! Regards, João Carlos. Edited July 23, 2012 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Belini Posted July 24, 2012 Posted July 24, 2012 @jscript the latest changes have been included in the script of the first post? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
JScript Posted July 24, 2012 Author Posted July 24, 2012 Not yet, I do not like to release a version after another in a short time... I'm doing testing and optimizing, when I fix some bugs I'll post a new version! Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
JScript Posted July 29, 2012 Author Posted July 29, 2012 (edited) Fixes:1.7.2912.2600b29/07/2012 -> Added new function: _GUICtrlPic_GetInfo()! Now first build a list / array of image frames to speed up drawing! Resize the picture with quality, thanks to the asdf8 at Some bugs were corrected and the UDF has been optimized for more faster execution, thanks to Belini!Regards,João Carlos. Edited July 29, 2012 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
UEZ Posted July 29, 2012 Posted July 29, 2012 Seems to be that the zip file is corrupt. Example 4 cannot be extracted. Br, 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
JScript Posted July 29, 2012 Author Posted July 29, 2012 Thanks for letting me know bout it, has now been corrected with a new upload! Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
JScript Posted August 3, 2012 Author Posted August 3, 2012 Fixes:1.8.0312.2600b03/08/2012 -> Now you can use the function _GUICtrlPic_SetImage() in the following static controls: GUICtrlCreatePic() or GUICtrlCreateLabel()!Regards,João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
MvGulik Posted August 4, 2012 Posted August 4, 2012 (edited) Whats that "2600b" in your ... erm ...version number? (feels OS (XP) related to me, but my brain is withholding why I think that.) 1.7.2012.2600b 1.7.2912.2600b 1.8.0312.2600b <major>.<month>.<[month-day:two digits][year:last 2 digits]>.<???> Edited August 4, 2012 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
JScript Posted August 4, 2012 Author Posted August 4, 2012 I'll try to explain: 1. => The major version number .8 => The current month, so I just modify the major version when the year changes .03 => The last day on which the code was finalized and tested 12 => The current year 2600 => Tested on Windows XP (Build 2600) b => (beta) The code is still being implemented, is not the final version. It was a way I found to guide me in when I making changes that will be adopted in all the code I write. Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
JScript Posted August 20, 2012 Author Posted August 20, 2012 Fixes:1.8.2012.2600bAdd -> _GUICtrlPic_Release() to frees memory used by the control without deleting it!Add -> Internal function __GRP_WM_DESTROY(), reason: If the window is closed, ensures that the memory is released if the control has not been deleted by _GUICtrlPic_Delete() function!FIX -> You can use the native function GUICtrlDelete() to delete a control from _GUICtrlPic_Create()!FIX -> _GUICtrlPic_SetImage() did not remove the previous image, thanks to Belini.Regards,João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Crayfish Posted November 16, 2012 Posted November 16, 2012 May I ask how to create a binary gif in your example?
JScript Posted November 16, 2012 Author Posted November 16, 2012 @CrayfishYou can use this program: JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Crayfish Posted November 17, 2012 Posted November 17, 2012 Thank you JScript - This UDF is incredible. Keep up the great work.
JScript Posted November 17, 2012 Author Posted November 17, 2012 You are welcome! JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
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