JScript Posted August 13, 2009 Posted August 13, 2009 (edited) Function Reference_GUIResourcePic.au3Functions related to the image control in the GUI.Sintax:_GUICtrlPic_Create( FileName, Left, Top [, Width [, Height [, Style [, ExStyle ]]]]]] ) _GUICtrlPic_SetImage( controlID, FileName [, FixSize ]]) _GUICtrlPic_Delete( controlID ) _GUICtrlPic_Release( controlID ) _GUICtrlPic_SetState( controlID, state ) _GUICtrlPic_GetInfo( FileName or Control ID )Supports:; Images in the format: .bmp, .jpg, .png, .gif {animated} and other formats of files for resources (.exe, .dll, .ocx, .cpl...). ; For the "resources", use the "FileName" in this format: "MyFile.ext|RessourceName|ResourceType". ; It can be a URL path as well!Download:Version: 1.8.2012.2600b_GUIResourcePic_(RedirectLink).html17.0k (Previous downloads: 140)Example_Include_HD_GIF_(RedirectLink).html36.08k (Previous downloads: 135)Note: Added new function! I've made significant changes in the code, including the syntax of some functions!Now uses GDI+ to render the images.Example of use is included!Sample:CPU in 0,60%.http://www.youtube.com/watch?v=NZZB-G9C1KgDirect download: _GUIResourcePic.mp4Fixes:1.8.2012.2600bAdd -> _GUICtrlPic_Release() to remove image and 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.1.8.0312.2600b03/08/2012 -> Now you can use the function _GUICtrlPic_SetImage() in the following static controls: GUICtrlCreatePic() or GUICtrlCreateLabel()!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!1.7.2012.2600b20/07/2012 -> Some bugs were corrected and the UDF has been optimized for faster execution!1.07b07/07/2012 -> The UDF has been completely rewritten, now uses GDI+ to render the images. Based on http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=1776 and Prog@ndy work concept! Styles and ExStyles:;----> State $GUI_GIFSTART ; If image is GIF animated, start/resume animation! $GUI_GIFSTOP ; If image is GIF animated, stop/pause animation! ;----> Style (GIS = Gif Image Styles) $GIS_ASPECTRATIOFIX ; Fix the image size based on aspect ratio. $GIS_HALFTRANSPARENCY ; The images are rendered with the window background color. This Style is default. $GIS_FULLTRANSPARENCY ; The frames are rendered in full transparency independent of the background color of the window! Note: This Style consumes more CPU because the exstyle $WS_EX_TRANSPARENT is added to each frame in real time! Not valid if the image does not have transparency! ;----> Default Style to _GUICtrlPic_Create()! $GIS_SS_DEFAULT_PIC = BitOR($GIS_HALFTRANSPARENCY, $SS_NOTIFY) ;----> ExStyle (GIS_EX = Gif Image Extended Styles) $GIS_EX_DEFAULTRENDER ; To use _GUIImageList_Draw in rendering of images, use less CPU. This ExStyle is default! $GIS_EX_CTRLSNDRENDER ; The frames is render using GUICtrlSendMsg, but consumes much more CPU!!! Note: If you use this ExStyle, only $GRP_FULLTRANSPARENCY is used for rendering images! 1.02b09/05/2012 -> After updating the code, the images with transparency were not being shown as they should, changed code again!09/05/2012 -> Fixes in the _GUICtrlPic_SetImage() function, the measures were not being updated according to the parameter FixSiz , identified by @Belini, thank you!Regards,João Carlos. Edited October 17, 2012 by JScript UEZ, mLipok, Wiliat87 and 1 other 4 http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Tlem Posted August 13, 2009 Posted August 13, 2009 Wonderful. Tank you very much. Best Regards.Thierry
JScript Posted August 14, 2009 Author Posted August 14, 2009 Wonderful.Tank you very much.Thank's, some add/modifications will be soon... http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Tlem Posted August 15, 2009 Posted August 15, 2009 (edited) Re-edit your code line 324. You have wrote : Return Return StringTrimLeft($sGetSysColor, 4) & StringTrimLeft(StringTrimRight($sGetSysColor, 2), 2) & StringTrimRight($sGetSysColor, 4) 2x Return make an error in Scite. >_< Edited August 15, 2009 by Tlem Best Regards.Thierry
JScript Posted August 15, 2009 Author Posted August 15, 2009 Re-edit your code line 324. You have wrote : Return Return StringTrimLeft($sGetSysColor, 4) & StringTrimLeft(StringTrimRight($sGetSysColor, 2), 2) & StringTrimRight($sGetSysColor, 4) 2x Return make an error in Scite. >_< Thank you my friend... 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 19, 2009 Author Posted August 19, 2009 (edited) *New update*Sintax:_GUICtrlPic_Create( FileName, Left, Top [, Width [, Height [, Style [, ExStyle ]]]]]] ) _GUICtrlPic_SetImage( controlID, FileName [, FixSize ]]) _GUICtrlPic_Delete( controlID ) _GUICtrlPic_SetState( controlID, state ) Edited July 8, 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!
DivSar Posted September 22, 2009 Posted September 22, 2009 Hi, All the pic png, gif are not transparent. How I can have transparent background pic ??? Thanks.
subzerostig Posted March 23, 2012 Posted March 23, 2012 Thanks, I really needed this but couldn't find anything that could do this There are 10 types of people in this world. Those that understand binary, and those that do not
JScript Posted March 23, 2012 Author Posted March 23, 2012 (edited) Hi!The UDF has been updated in 2012/03/23!With example included...Regards,João Carlos. Edited March 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 March 24, 2012 Posted March 24, 2012 It will be very helpful for me, thanks for sharing. 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 May 17, 2012 Author Posted May 17, 2012 The UDF has been completely rewritten, bug fixes and is more stable! 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 8, 2012 Author Posted July 8, 2012 Now the UDF uses GDI+ to render the images!Based on http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=1776 and Prog@ndy work concept.Very low CPU usage, in most case uses 0%!!!Gif with 720x305x24fps uses 0,12% (Core i7)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!
Vinh Posted July 9, 2012 Posted July 9, 2012 Can I use GuiCtrlDelete to delete control create with this udf?
JScript Posted July 9, 2012 Author Posted July 9, 2012 (edited) Yes and no, the correct is use _GUICtrlPic_Delete (ControlID) function!Other built-in functions can be used.Edit: If you add the following code at the end of __GRP_DrawFrame() function, you can delete using the native function.In which case the memory will be safely released!If Not GUICtrlGetHandle($avGRP_CTRLIDS[$iIndex][0]) Then ; If image is GIF animated... __GRP_ReleaseGIF($iIndex) EndIfRegards,João Carlos. Edited July 9, 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!
JScript Posted July 21, 2012 Author Posted July 21, 2012 *New version*v1.7.2012.2600b -> Some bugs were corrected and the UDF has been optimized for faster execution!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 22, 2012 Posted July 22, 2012 Hi, I liked this job. Slightly changed it for yourself. Changes: - improved use as UDF - slightly modified to work with resource files_GUIResourcePic.zip
JScript Posted July 22, 2012 Author Posted July 22, 2012 (edited) Cool, I'm very glad you liked it! But looking at what you did, I did not see anything that no longer exist in the UDF! You said:- improved use as UDFOk, I liked And:- slightly modified to work with resource filesBut the UDF has already work with resources, see:; For the "resources", use the "FileName" in this format: "MyFile.ext|RessourceName|ResourceType". In any case, thank you for the improvements! Regards, João Carlos. Edited July 22, 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 22, 2012 Posted July 22, 2012 JScript,may make sense to change the format for "resources" :; For the "resources", use the "FileName" in this format: "RessourceName|[RessourceFile = 0[|ResourceType = 10]]". JScript 1
JScript Posted July 22, 2012 Author Posted July 22, 2012 I really liked the idea, I'll make the changes and testing, when I finish I'll show you! Thanks! 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 There is a problem - a low quality of the scaled images, and, herewith, for the animation greatly increases the CPU.
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