Sign in to follow this  
Followers 0
wakillon

Html-Imager Update of 17 Dec 2014

28 posts in this topic

#1 ·  Posted (edited)

2016020320555060os6.jpg

A simple script for generate a Html file with Images and some few features.

As usual external files and includes are embedded.

Compatible with AutoIt Versions 3.3.8.1 to 3.3.13.19

ChangeLog v 1.0.1.3

You can now Add/Manage Prev/Next/Home/Top/Bottom Page Links from Gui Menu.

 

Previous downloads : 111

Downloads available in the download section

 

Hope this example can be useful to someone !  :)

Edited by wakillon
3 people like this

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Heya wakillon, any chance you could post the code without stripping it down? (with just the includes)

That makes for a lot of code to look through.

Edit:

This is just a request, no have toos!

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi SmOke_N

No problem you can get it here 

There are still more than 1500 lines to read !  :D

And it's only compatible with the last release.

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Thanks, I'll dig through that "short" ;) code in a bit :).


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

All my apologies, finalizing the code, i have created a bug.

Fixed version uploaded. :sweating:


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I selected a folder with 980 pictures and it took several minutes to load all those pictures.

  1. Can you try to speed it up?
  2. An abort feature would be great
  3. Double click on a picture will open the picture in e.g. default app or you display it
  4. How about a cool JS About intro? ;)

The last 4 pictures have no preview image in listview.

 

Br,

UEZ

Edited by 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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I selected a folder with 980 pictures and it took several minutes to load all those pictures.

  1. Can you try to speed it up?
  2. An abort feature would be great
  3. Double click on a picture will open the picture in e.g. default app or you display it
  4. How about a cool JS About intro? ;)

The last 4 pictures have no preview image in listview.

 

Br,

UEZ

 

Hi UEZ !

1 no cause cpu usage will be too high

2 yes it can be added

3 yes it can be added too

4 What's that "JS About intro" ?

Thumbs in listview are loaded in memory for be resized with GDI functions, so may be the images count you have tried to load is a bit excessive... :P

Take a look to your CPU usage at the same time...

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hi UEZ !

1 no cause cpu usage will be too high

2 yes it can be added

3 yes it can be added too

4 What's that "JS About intro" ?

Thumbs in listview are loaded in memory for be resized with GDI functions, so may be the images count you have tried to load is a bit excessive... :P

Take a look to your CPU usage at the same time...

 

Regarding 1 (never say never ;)):

I reduced the time from 166s to 66s using this modification of the function _GUICtrlListView_AdaptImage():

Func _GUICtrlListView_AdaptImage ( $hListView, $hImageList, $iIndex, $sFilePath, $iImageSize=128 )
    If Not FileExists ( $sFilePath ) Then Return SetError ( 1, 0, 0 )
    Local $hBitmap = _GDIPlus_BitmapCreateFromFile ( $sFilePath )
    Local $iNewWidth, $iNewHeight, $hBitmap_Scaled1, $hBitmap_Scaled2, $hGraphic, $iRatio
    Local $iWidth = _GDIPlus_ImageGetWidth ( $hBitmap )
    Local $iHeight = _GDIPlus_ImageGetHeight ( $hBitmap )
    ; keep ratio.
    If $iWidth >= $iHeight Then ; square or horizontal image.
        $iRatio = $iHeight/$iWidth
        $iNewWidth = $iImageSize
        $iNewHeight = Int ( $iImageSize * $iRatio )
    Else ; vertical image.
        $iRatio = $iWidth/$iHeight
        $iNewWidth = Int ( $iImageSize * $iRatio )
        $iNewHeight = $iImageSize
    EndIf
    $hBitmap_Scaled2 = _GDIPlus_BitmapCreateFromScan0($iImageSize, $iImageSize) ; _GDIPlus_ImageResizeEx ( $hBitmap, $iImageSize, $iImageSize )
    $hGraphic = _GDIPlus_ImageGetGraphicsContext ( $hBitmap_Scaled2 )
    _GDIPlus_GraphicsDrawImageRectRect ( $hGraphic, $hBitmap, _
        0, _
        0, _
        $iWidth, _
        $iHeight, _
        0, _
        0, _
        $iNewWidth, _
        $iNewHeight )
    Local $hImageBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap ( $hBitmap_Scaled2 )
    _GUIImageList_Add ( $hImageList, $hImageBMP )
    _WinAPI_DeleteObject ( $hImageBMP )
    _GDIPlus_GraphicsDispose ( $hGraphic )
    _GDIPlus_BitmapDispose ( $hBitmap_Scaled2 )
    _GDIPlus_BitmapDispose ( $hBitmap )
    _GUICtrlListView_AddItem ( $hListView, '', $iIndex )
EndFunc ;==> _GUICtrlListView_AdaptImage()

and removed the Sleep(10) from some of the functions.

 

Regarding 4:

You create a html for your About section. It would be cool to add some JavaScript effects, at least I would do it.  :D

 

Br,

UEZ

Edited by 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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

wakillon

Good work, thanks for sharing.

 

mLipok


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Thanks for sharing!


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

UEZ 

1) You have not understood all the utility of this function

it allows to create a thumbnails, yes , but it also allows this thumbnails to be displayed centered in his listview item.
Your modifications remove this functionality ! 
 
Why do you think i have added some "Sleep(10)" in each loops ?
 
I have tried with 1520 images in 178 sec ( so it need 0,11 sec for create each thumbnails)
CPU was about 20% and memory consumption was about 210000 K
So, It's already high !
If i remove all the "Sleep(10)", and test in the same conditions, yes it's a bit more fast, but my CPU rises above 25%
 
Increase the speed of execution is a good thing in itself, but you need to count the resources used too!  ;)
(am I speaking as an ecologist ?  :D)
 
4) Working on this script about HTML, I thought it was tasteful to have an "About" in HTML too, but my knowledges about it, is limited !  :P
But you know that javascript is not my cup of tea and I seem to remember that it was your case too ! no ?  :)
 
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

I didn't catch the center feature but that shouldn't hard to add:

Func _GUICtrlListView_AdaptImage ( $hListView, $hImageList, $iIndex, $sFilePath, $iImageSize=128 )
    If Not FileExists ( $sFilePath ) Then Return SetError ( 1, 0, 0 )
    Local $hBitmap = _GDIPlus_BitmapCreateFromFile ( $sFilePath )
    Local $iNewWidth, $iNewHeight, $hBitmap_Scaled1, $hBitmap_Scaled2, $hGraphic, $iRatio
    Local $iWidth = _GDIPlus_ImageGetWidth ( $hBitmap )
    Local $iHeight = _GDIPlus_ImageGetHeight ( $hBitmap )
    ; keep ratio.
    If $iWidth >= $iHeight Then ; square or horizontal image.
        $iRatio = $iHeight/$iWidth
        $iNewWidth = $iImageSize
        $iNewHeight = Int ( $iImageSize * $iRatio )
    Else ; vertical image.
        $iRatio = $iWidth/$iHeight
        $iNewWidth = Int ( $iImageSize * $iRatio )
        $iNewHeight = $iImageSize
    EndIf
    $hBitmap_Scaled2 = _GDIPlus_BitmapCreateFromScan0($iImageSize, $iImageSize) ; _GDIPlus_ImageResizeEx ( $hBitmap, $iImageSize, $iImageSize )
    $hGraphic = _GDIPlus_ImageGetGraphicsContext ( $hBitmap_Scaled2 )
    If $iWidth < $iImageSize And $iHeight < $iImageSize Then
        _GDIPlus_GraphicsDrawImageRect( $hGraphic, $hBitmap, ($iImageSize - $iWidth) / 2, ($iImageSize - $iHeight) / 2, $iWidth, $iHeight)
    Else
        _GDIPlus_GraphicsDrawImageRectRect ( $hGraphic, $hBitmap, _
            0, _
            0, _
            $iWidth, _
            $iHeight, _
            ($iImageSize - $iNewWidth) / 2, _
            ($iImageSize - $iNewHeight) / 2, _
            $iNewWidth, _
            $iNewHeight )
    EndIf
    Local $hImageBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap ( $hBitmap_Scaled2 )
    _GUIImageList_Add ( $hImageList, $hImageBMP )
    _WinAPI_DeleteObject ( $hImageBMP )
    _GDIPlus_GraphicsDispose ( $hGraphic )
    _GDIPlus_BitmapDispose ( $hBitmap_Scaled2 )
    _GDIPlus_BitmapDispose ( $hBitmap )
    _GUICtrlListView_AddItem ( $hListView, '', $iIndex )
EndFunc ;==> _GUICtrlListView_AdaptImage()

Imho, it doesn't matter whether the CPU usage is at 25% or 20% because it is for a limited of a time.

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Imho, it doesn't matter whether the CPU usage is at 25% or 20% because it is for a limited of a time.

 

Depends if you are doing something else at the same time...

Your last modification is better, but do i need to consider that your new _GDIPlus_ImageResize function is too slow ?  :D

And for javascript all i have made is >here (be patient it's a bit slow to start)

:)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Well, when you call _GDIPlus_GraphicsDrawImageRect* twice or more times it is slower than when you call it only once regardless whether _GDIPlus_GraphicsDrawImageRect* are slow functions...

Regarding the CPU usage. 25% usage means you have 4 cores and one is busy with you script. The other 3 cores are idle and waiting for some "work".

If you need some cool JS stuff have a look here: http://js1k.com/

Br,

UEZ

Edited by 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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Updated

Suggestions :

1) 50% done

2) done

3) done

4) may be...


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

The counting of the images seems not to work properly. After all 979 images are loaded the "current selection" is 1/979 although all thumbs are selected (as seen on your screenshot).

Selecting / unselecting count seems also not to work.

Br,

UEZ

Edited by 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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

The counting of the images seems not to work properly. After all 979 images are loaded the "current selection" is 1/979 although all thumbs are selected.

Selecting / unselecting count seems also not to work.

Br,

UEZ

 

I just load 1520 images without any problems

And multi select should not be possible as listview use $LVS_SINGLESEL style.

I can't reproduce your error...

Edit : if there is no selection, the selection label is empty. 

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

Ok, I understood the "Current Selection" differently. I thought it is the count of all checked thumbs but it shows the position of the current selection only.

Sorry.

The JS (rotating balls) is very nice  :thumbsup: . Can you bring them behind the text?

Br,
UEZ

Edited by 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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • fatpig
      By fatpig
      Dear AutoIT Community.
      I am currently working on a program that will display lots of images in a scroll down GUI.
      I create the GUI based on the number of images, which works fine.
      But all images I place using GuiCtrlCreatePic above a threshold of around 32000 pixels (cant say exactly) are placed at negative locations and finally will reach 0 again
      and will then populate on top of the images placed there before.
      For $i = 1 To $Images[0] ; Get picture dimensions $hImage = _GDIPlus_ImageLoadFromFile($ImgRep & $Images[$i]) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) _GDIPlus_ImageDispose($hImage) ; Resize & place images in GUI $Pic[$i] = GUICtrlCreatePic($ImgRep & $Images[$i], $Spacer, Round($yPos, 0), $MaxImgWidth, $MaxImgWidth * ($iY / $iX)) $yPos = $yPos + $MaxImgWidth * ($iY / $iX) + $Spacer $log = $log & "|" & $yPos $currentlut = $Images[1] Next I have found a limit at 32767 pixels for some GUI elements when googling around.
      Can someone tell me how to circumvent that?
      thanks!
      cheers
      Felix
    • islandspapand
      By islandspapand
      Hi all
      i am currently trying to click on an element in a HTML Table, but just can get it to work.
      i am able to click the top of the table so it changes to sort  but just can't click on the element in the table.
      an i need to click on element to continue in the site.
      i have attached the code so far and pictures of the table  element want to click plus the source of the table.
      i am able to get data in the table with $oTable = _IETableGetCollection($oIE, 2) but not able to click on them.
       
      Help is very much appreciated
       
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <IE.au3> #include "DOM.au3" #include <Array.au3> #include <MsgBoxConstants.au3> Global $oIE = _IECreate("*") _IELoadWait($oIE) Sleep(2000) _PageLogin($oIE) _PageLoadWait() _PageNewReq($oIE) _PageLoadWait() _InputModelInf($oIE) _PageLoadWait() Sleep(1000) $aTableLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE, "//table/tbody/tr/td[.='Name Of user']", 2000) ;~ $aTableLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE, "//table/tbody/tr", 2000) ;~ _ArrayDisplay($aTableLink,"$aTableLink") If IsArray($aTableLink) Then ConsoleWrite("Able to BGe_IEGetDOMObjByXPathWithAttributes($oIE, //table/tbody/tr/td[.='Name Of user'])" & @CRLF) For $i = 0 To UBound($aTableLink)-1 ConsoleWrite(" OuterHTML : " & $aTableLink[$i].outerHTML & @CRLF) ConsoleWrite(" Parentnode : " & $aTableLink[$i].parentnode & @CRLF) ConsoleWrite(" Parentnode.click : " & $aTableLink[$i].parentnode.fireEvent("onclick","click") & @CRLF) $objClick = $aTableLink[$i].parentnode ;~ _IEAction($aTableLink[$i] , "focus") _IEAction($objClick , "focus") ;~ If _IEAction($aTableLink[$i], "click") Then If _IEAction($objClick, "click") Then ConsoleWrite("Able to _IEAction($aForumLink[0], 'click')" & @CRLF) _IELoadWait($oIE) Else ConsoleWrite("UNable to _IEAction($aForumLink[0], 'click')" & @CRLF) Exit 3 EndIf Next Else ConsoleWrite("Unable to BGe_IEGetDOMObjByXPathWithAttributes($oIE, //table/tbody/tr/td[.='Name Of user'])" & @CRLF) Exit 2 EndIf _PageLoadWait() Func _InputModelInf($oTmpIE) ; Add Var for Model & Serial in Func $oModelInput = _IEGetObjById($oTmpIE,"model") _IEAction($oModelInput,"focus") _IEDocInsertText($oModelInput, "*") $oSerialInput = _IEGetObjById($oTmpIE,"serial") _IEAction($oModelInput,"focus") _IEDocInsertText($oSerialInput, "*") $links = $oTmpIE.document.getElementsByClassName("btn btn-primary ng-scope") For $link In $links If $link.innertext = "Søg" Or $link.innertext = "Search" Then $link.click() ExitLoop EndIf Next Return True EndFunc Func _PageNewReq($oTmpIE) $links = $oTmpIE.document.getElementsByClassName("ng-scope k-link") For $link In $links If $link.innertext = "Send ny fejlmelding" Or $link.innertext = "Submit a New Service Request" Then $link.click() ExitLoop EndIf Next Return True EndFunc Func _PageLogin($oTmpIE) $oUserInput = _IEGetObjById($oTmpIE,"loginid") _IEDocInsertText($oUserInput, "*") $oPasswordInput = _IEGetObjById($oTmpIE,"password") _IEDocInsertText($oPasswordInput, "*") $links = $oTmpIE.document.getElementsByClassName("btn btn-primary login ng-scope") For $link In $links If $link.innertext = "Sign in" Then $link.click() ExitLoop EndIf Next Return True EndFunc Func _PageLoadWait() Local $PageLoadWait = False ;~ nav navbar-nav navbar-right ng-hide ;~ nav navbar-nav navbar-right $tags = $oIE.document.GetElementsByTagName("ul") For $tag in $tags $class_value = $tag.GetAttribute("class") If $class_value = "nav navbar-nav navbar-right" Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Webpage loading :) ' & @CRLF) ;### Debug Console $PageLoadWait = True ExitLoop EndIf Next Do sleep(250) For $tag in $tags $class_value = $tag.GetAttribute("class") If $class_value = "nav navbar-nav navbar-right ng-hide" Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Webpage load finished :)'& @CRLF) ;### Debug Console $PageLoadWait = False ExitLoop EndIf Next Until $PageLoadWait = False EndFunc  
      Thanks in advance
       
       


    • Spask
      By Spask
      Hi, I'm trying to find a text value inside of a html.
      This is what the line looks like normally:
      <p id="line1" class> <span class="bot">TEXT HERE</span> </p> The text then changes to a non breaking space:
      <p id="line1" class> <span class="bot">&nbsp;</span> </p> And then it changes back to normal text but it's different every time.
      Can I code this so that it grabs the text every time it changes and has a variable that represents it?
      I currently have this inside of my loop:
      $span = .document.getElementsByTagName("span") For $text In $span If $text.value = "&nbsp;" Then Sleep(50) MsgBox(0,0,0) ;messagebox to test if it can be found, but I don't know how to grab the text EndIf Next The problem is that there are many other lines in the html that have the same span but are called "line3", "line5", etc and the one I need is from "line1".
      I will appreciate if anyone can help with this!
    • DeathChicken
      By DeathChicken
      If possible please add or edit the comments to explain how this works.
       
      ;includes functions from other things
      #include <GDIPlus.au3>
      #include <ScreenCapture.au3>
      ;hotkeys
      HotKeySet("{ESC}", _exit)
      HotKeySet("{F1}", _scan)
      ;global variables
      Global $win_title                    ;name of the window
      Global $area_x                        ;
      Global $area_y                        ;
      Global $area_w                       ;
      Global $area_h                        ;
      Global $cursor                         ;
      Global $rect_file                      ;
      Global $hbmpscreen              ;
      Global $i=  1043                      ;moves the rect
      Global $ii=    378                      ;moves the rect
      Global $x=1044                        ;inner rect offset
      Global $y=501                          ;inner rect offset
      Global $hbmprect                    ;image inside rect
      Global $hscreen                        ;image whole screen
                                         
      _GDIPlus_Startup()                    ;?
      ;display hotkeys on screen
      ToolTip("Press F1 to scan | Press ESC to Exit",0,0)
                                          ;infinite loop to keep prog running
      While 1
          Sleep(100)
      WEnd
      Func _scan()
      ;~ reads your screen area:
      _read()
      ;~ converts screen captured into bmp
      _convert()
      ;~ .  Loads converted bmp to be read
      _loadBMP()
      ;~ compares the bmp of your scanned screen to the actual screen that is being displayed
      _compare()
      EndFunc
                                          ;reads screen
      Func _read()
          $hscreen = _ScreenCapture_CaptureWnd("", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor)
      EndFunc
                                          ;converts screen into bmp
      Func _convert()
          _GDIPlus_BitmapCreateFromHBITMAP($hscreen)
      EndFunc
                                          ;loads converted screen
      Func _loadBMP()
      _GDIPlus_BitmapCreateFromFile($rect_file)
      EndFunc
                                          ;compares savedBMP to current screen
      Func _compare()
      ;If(                              below code                                     ) = (                   below code           ) Then
      If _GDIPlus_BitmapGetPixel($hbmpscreen, ($i + $x) - $area_x, ($ii + $y) - $area_y) = _GDIPlus_BitmapGetPixel($hbmprect, $x, $y) Then
      ;display message box titled found with a message of found
      MsgBox("","","found")
      ;if above is not correct then
      EndIf
      EndFunc
                                          ;exit func
      Func _exit()
          Exit
      EndFunc
    • GordonFreeman
      By GordonFreeman
      Hi, i searched some topics but cannot found a simple way to do that:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 124) GUISetState(@SW_SHOW) ; I tried this but user reported that it work in 2006, not seems work actually $filemenu = GUICtrlCreateMenu ("&File") $fileitem = GUICtrlCreateMenuitem ("Open",$filemenu) GuiCtrlSetImage($fileitem, "shell32.dll", 4) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Also tried:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 124) GUISetState(@SW_SHOW) $filemenu = TrayCreateMenu("&File") $fileitem = TrayCreateItem("Open",$filemenu) ;GuiCtrlSetImage($fileitem, "shell32.dll", 4) ;GuiCtrlSetImage(TrayItemGetHandle($fileitem), "shell32.dll", 4) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Well.. thanks in advance!
       
      Ok. I found this working example from Yashied. If i cannot find a simple then i will go with it
      #Include <GUIConstantsEx.au3> #Include <GUIMenu.au3> #Include <Constants.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Global $hMenu, $hForm, $hFile = 1000, $idNew, $idExit $hForm = GUICreate('Menu', 400, 300) $hFile = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem ($hFile, 0, ' &Favorites', $idNew) _GUICtrlMenu_InsertMenuItem ($hFile, 1, '', 0) _GUICtrlMenu_InsertMenuItem($hFile, 2, ' E&xit', $idExit) $hMenu = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem($hMenu, 0, '&File', 0, $hFile) _GUICtrlMenu_SetMenu($hForm, $hMenu) _GUICtrlMenu_SetItemBmp($hFile, 0, _CreateBitmapFromIcon(_WinAPI_GetSysColor($COLOR_MENU), @SystemDir & '\shell32.dll', 43, 16, 16)) _GUICtrlMenu_SetItemBmp($hFile, 2, _CreateBitmapFromIcon(_WinAPI_GetSysColor($COLOR_MENU), @SystemDir & '\shell32.dll', 27, 16, 16)) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _CreateBitmapFromIcon($iBackground, $sIcon, $iIndex, $iWidth, $iHeight) Local $hDC, $hBackDC, $hBackSv, $hIcon, $hBitmap $hDC = _WinAPI_GetDC(0) $hBackDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateSolidBitmap(0, $iBackground, $iWidth, $iHeight) $hBackSv = _WinAPI_SelectObject($hBackDC, $hBitmap) $hIcon = _WinAPI_PrivateExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) If Not @error Then _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, 0, 0, 0, 0, $DI_NORMAL) _WinAPI_DestroyIcon($hIcon) EndIf _WinAPI_SelectObject($hBackDC, $hBackSv) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_DeleteDC($hBackDC) Return $hBitmap EndFunc ;==>_CreateBitmapFromIcon Func _WinAPI_PrivateExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) Local $hIcon, $tIcon = DllStructCreate('hwnd'), $tID = DllStructCreate('hwnd') Local $Ret = DllCall('user32.dll', 'int', 'PrivateExtractIcons', 'str', $sIcon, 'int', $iIndex, 'int', $iWidth, 'int', $iHeight, 'ptr', DllStructGetPtr($tIcon), 'ptr', DllStructGetPtr($tID), 'int', 1, 'int', 0) If (@error) Or ($Ret[0] = 0) Then Return SetError(1, 0, 0) EndIf $hIcon = DllStructGetData($tIcon, 1) If ($hIcon = Ptr(0)) Or (Not IsPtr($hIcon)) Then Return SetError(1, 0, 0) EndIf Return $hIcon EndFunc ;==>_WinAPI_PrivateExtractIcon Ok, i noticed that is a pain create submenu with _GUICtrlMenu_CreatePopup to do like in Tray, and Tray better located, then i need images/icon with Tray functions, some workaround??