Jump to content

$LVN_HOTTRACK and adding a pic.


Recommended Posts

using $LVN_HOTTRACK so when i hover over the listview i get the image.....

but it only works for the first 3-4 items in the listview.

can u guys come up with something a bit more efficient please. maybee by loading images to memory.? then calling from memory

Am using both .jpg files and .png

Case $LVN_HOTTRACK; Sent by a list-view control when the user moves the mouse over an item
                    Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)


                    $row = DllStructGetData($tInfo, "Item")
                    
                    If $last = -1 Then GUICtrlSetImage($Pic1, "")
                    If $last <> $row Then
                        $last = $row
                        $list_name=_GUICtrlListView_GetItemText($ListView, $row) 
$list_name=StringReplace($list_name," ","_")
ConsoleWrite($list_name&@lf)
                            
                            
                            
                            _GDIPlus_Startup()
                            for $ln=1 to $flist[0]
                                if StringInStr($flist[$ln],".Jpg")>0 and StringInStr($list_name,$flist[$ln])>0 then
                             $hImage = _GDIPlus_ImageLoadFromFile("C:\foo\"&$list_name&".jpg");png
                         Else
                             $hImage = _GDIPlus_ImageLoadFromFile("C:\foo\"&$list_name&".png")  
                            EndIf
                            Next
                            Local $hCLSID = _GDIPlus_EncodersGetCLSID("BMP")
                            _GDIPlus_ImageSaveToFileEx($hImage, @ScriptDir & "\test.bmp", $hCLSID)
                            $set=GUICtrlSetImage($Pic1, @ScriptDir & "\test.bmp")
                    ;GUICtrlSetImage($Pic1, "C:\foo\"&$list_name&".Jpg")    
if $set=0 Then GUICtrlSetImage($Pic1, "")
                            _GDIPlus_ImageDispose($hImage)
                            _GDIPlus_Shutdown()


                ;ElseIf _GUICtrlListView_GetItemText($ListView, $row) = "testa" Then
                ;   GUICtrlSetImage($Pic1, "C:\foo\Austere_Hat.Jpg")
                ;EndIf
                    EndIf
Edited by Aceguy
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...