
site linki:https://altin.in/fiyat/gram-altin
ben burdaki grafiği benim scriptime eklemek istiyorum ama autoit formlarında benzerine rastlamadım yada ben bulamadım. lütfen yardımcı olur musunuz. grafik kısmını scipte göstersem yeterli.


Kod: Tümünü seç
Opt("GUIOnEventMode", 1)
Global $MAIN_PAGE = GUICreate("", 800, 600, -1, -1)
GUISetOnEvent(-3, "_GuiExit")
Global $MAIN_PAGE2 = GUICreate("", 650, 300, 100, 100, BitOR(0x40000000, 0x00010000, 0x00080000), 0x10000, $MAIN_PAGE)
Global $OBJ_oIE = ObjCreate("Shell.Explorer.2")
ObjEvent("AutoIt.Error", "_Obj_Error")
Global $GUI_OBJ = GUICtrlCreateObj($OBJ_oIE, -10, -350, 1024, 1024)
GUICtrlSetResizing($GUI_OBJ, 802)
$OBJ_oIE.navigate("https://altin.in/fiyat/gram-altin")
GUISwitch($MAIN_PAGE)
GUICtrlCreateButton("Test", 10, 10, 100,25)
GUISetState(@SW_SHOWNOACTIVATE, $MAIN_PAGE2) ;@SW_SHOWNOACTIVATE
GUISetState(@SW_SHOW, $MAIN_PAGE)
While 1
Sleep(100)
WEnd
Func _GuiExit()
Exit
EndFunc ;==>_GuiExit
Func _IE_BUSY(ByRef $Obj, $Wait = 2500)
While $Obj.Busy()
Sleep(50)
$Wait -= 50
If $Wait < 0 Then ExitLoop ;$BLUE_OIE.stop
WEnd
EndFunc ;==>_IE_BUSY
Func _Obj_Error()
EndFunc ;==>_Obj_ErrorBlueLife yazdı: 18 May 2018, 10:29 @ x_files_x
Selam, sitedeki resim sabit olsaydı htlm kodlarından resmin linkni bulup indirip direk kullanabilirdin. Malesef sitenin htlm verisinde ilgili bölüm için sabit resim yok. Obj komutlarıyla sitenin belli bir kısmını gui ekranında göterebilirsin ama bu da düzgün çalışmayacaktır. Aklıma başka alternatif bir yöntem gelmiyor malesef. Obj için basit bir örnek;
Kod: Tümünü seç
Opt("GUIOnEventMode", 1) Global $MAIN_PAGE = GUICreate("", 800, 600, -1, -1) GUISetOnEvent(-3, "_GuiExit") Global $MAIN_PAGE2 = GUICreate("", 650, 300, 100, 100, BitOR(0x40000000, 0x00010000, 0x00080000), 0x10000, $MAIN_PAGE) Global $OBJ_oIE = ObjCreate("Shell.Explorer.2") ObjEvent("AutoIt.Error", "_Obj_Error") Global $GUI_OBJ = GUICtrlCreateObj($OBJ_oIE, -10, -350, 1024, 1024) GUICtrlSetResizing($GUI_OBJ, 802) $OBJ_oIE.navigate("https://altin.in/fiyat/gram-altin") GUISwitch($MAIN_PAGE) GUICtrlCreateButton("Test", 10, 10, 100,25) GUISetState(@SW_SHOWNOACTIVATE, $MAIN_PAGE2) ;@SW_SHOWNOACTIVATE GUISetState(@SW_SHOW, $MAIN_PAGE) While 1 Sleep(100) WEnd Func _GuiExit() Exit EndFunc ;==>_GuiExit Func _IE_BUSY(ByRef $Obj, $Wait = 2500) While $Obj.Busy() Sleep(50) $Wait -= 50 If $Wait < 0 Then ExitLoop ;$BLUE_OIE.stop WEnd EndFunc ;==>_IE_BUSY Func _Obj_Error() EndFunc ;==>_Obj_Error

Kod: Tümünü seç
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
;Resimin linki sabit ise direk resimin linkini, sabit değil belli bir etiket içindeyse ise aşağıdaki gibi bir şey kullanılabilir.
Local $sData = StringStripWS(BinaryToString(InetRead("http://www.autoitscript.com")), 8)
;Belirli etiketler (sabit yazılar vs.) içindeki resmin linkini bulalalım.
Local $InStr = StringInStr($sData, '<divclass="logo_container">')
$sData = StringTrimLeft($sData, $InStr)
$InStr = StringInStr($sData, "this.src=")
$sData = StringTrimLeft($sData, $InStr + StringLen("this.src="))
$InStr = StringInStr($sData, "';")
$sData = StringLeft($sData, $InStr - 1)
If StringLen($sData) = 0 Then
MsgBox(64, "", "Resmin Linki Alınamadı vs.")
Exit
EndIf
MsgBox(4096, "Resimin Linki", $sData)
;Resimi Indirelim. Tabi ben basit örnek kod veriyorum.
;Yardım dosyasındaki örnek
Local $hDownload = InetGet($sData, @TempDir & "\logo.png", 0, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload) ; Close the handle to release resources.
;MsgBox(0, "", "Bytes read: " & $nBytes)
; Create GUI
Global $hGUI = GUICreate("Show PNG", 640, 480)
GUISetBkColor(0)
GUISetState()
; Load PNG image
_GDIPlus_Startup()
Global $hImage = _GDIPlus_ImageLoadFromFile(@TempDir & "\logo.png")
; Draw PNG image
Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
; Loop until user exits
Do
Until GUIGetMsg() = -3
; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()BlueLife yazdı: 22 May 2018, 10:16 @ x_files_x
Teşekkür ederim iyidir, seni hatırlıyorum sen nasılsın? :)
Konuya dönersek yardım dosyasından vs. yararlanarak basit bir örnek hazırladım. Sitenin htlm dosyasını okuyup, sonra belirli etiketteki (siteye göre değişir) resmin linkini buluyoruz. Bulunca indirip kullanıyoruz...
Kod: Tümünü seç
#include <GUIConstantsEx.au3> #include <GDIPlus.au3> ;Resimin linki sabit ise direk resimin linkini, sabit değil belli bir etiket içindeyse ise aşağıdaki gibi bir şey kullanılabilir. Local $sData = StringStripWS(BinaryToString(InetRead("http://www.autoitscript.com")), 8) ;Belirli etiketler (sabit yazılar vs.) içindeki resmin linkini bulalalım. Local $InStr = StringInStr($sData, '<divclass="logo_container">') $sData = StringTrimLeft($sData, $InStr) $InStr = StringInStr($sData, "this.src=") $sData = StringTrimLeft($sData, $InStr + StringLen("this.src=")) $InStr = StringInStr($sData, "';") $sData = StringLeft($sData, $InStr - 1) If StringLen($sData) = 0 Then MsgBox(64, "", "Resmin Linki Alınamadı vs.") Exit EndIf MsgBox(4096, "Resimin Linki", $sData) ;Resimi Indirelim. Tabi ben basit örnek kod veriyorum. ;Yardım dosyasındaki örnek Local $hDownload = InetGet($sData, @TempDir & "\logo.png", 0, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) ; Check if the download is complete. Local $nBytes = InetGetInfo($hDownload, 0) InetClose($hDownload) ; Close the handle to release resources. ;MsgBox(0, "", "Bytes read: " & $nBytes) ; Create GUI Global $hGUI = GUICreate("Show PNG", 640, 480) GUISetBkColor(0) GUISetState() ; Load PNG image _GDIPlus_Startup() Global $hImage = _GDIPlus_ImageLoadFromFile(@TempDir & "\logo.png") ; Draw PNG image Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) ; Loop until user exits Do Until GUIGetMsg() = -3 ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown()