Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 01:58

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



FFSaveBMP

Discussion on FFSaveBMP within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1

 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
FFSaveBMP

Hey,

ich benutze die FFSaveBMP Funktion von der FastFind.au3, um Screenshots zu speichern. Leider hab ich ein Problem damit. Wenn man nämlich die Funktion mehrmals für den selben Pfad aufruft, bekommt man das:

FFSaveBMP("test")



Ich würde aber gerne das Bild immer überschreiben lassen, da ein Screenshot 6MB groß ist und ich nicht nach ein paar Stunden die Festplatte voll machen will ...

Ich konnte die Funktion nicht so umschreiben, dass sie das Bild immer überschreibt. Merkwürdigerweise funktioniert FileDelete() bei den Bildern nicht. Auch wenn ich sie davor mit FileSetAttrib auf -F stelle. Ich will ungern eine andere Funktion als FFSaveBMP benutzen, weil sie sehr schnell ist. Hat daher jemand eine Lösung für mich?
Moneypulation is offline  
Old 07/31/2015, 01:01   #2
 
elite*gold: 0
Join Date: Mar 2010
Posts: 360
Received Thanks: 132
ersetze die Alte Funktion mit der hier, damit gehts

Code:
Func FFSaveBMP($FileNameWithNoExtension, $ForceNewSnap=false, $Left=0, $Top=0, $Right=0, $Bottom=0, $NoSnapShot=$FFLastSnap, $WindowHandle=-1)
	if Not SnapShotPreProcessor($Left, $Top, $Right, $Bottom, $ForceNewSnap, $NoSnapShot, $WindowHandle) Then
		SetError(2)
		Return False
		EndIf
	local $Result = DllCall($FFDllHandle, "BOOLEAN", "SaveBMP", "int", $NoSnapShot, "str", $FileNameWithNoExtension)
	If ((Not IsArray($Result)) OR $Result[0]<>1) Then
		SetError(1)
		Return False
	EndIf
	local $Suffixe = DllCall($FFDllHandle, "int", "GetLastFileSuffix")
	If (IsArray($Result)) Then
			$LastFileNameParam = $FileNameWithNoExtension+".BMP"
	EndIf
	return true
EndFunc
Daifoku is offline  
Thanks
1 User
Old 07/31/2015, 01:10   #3
 
°Incinerate's Avatar
 
elite*gold: 400
Join Date: Jun 2011
Posts: 513
Received Thanks: 101
Bei mir fuktioniert FileDelete wunderbar.
°Incinerate is offline  
Old 07/31/2015, 01:12   #4

 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
Quote:
Originally Posted by Daifoku View Post
ersetze die Alte Funktion mit der hier, damit gehts

Code:
Func FFSaveBMP($FileNameWithNoExtension, $ForceNewSnap=false, $Left=0, $Top=0, $Right=0, $Bottom=0, $NoSnapShot=$FFLastSnap, $WindowHandle=-1)
	if Not SnapShotPreProcessor($Left, $Top, $Right, $Bottom, $ForceNewSnap, $NoSnapShot, $WindowHandle) Then
		SetError(2)
		Return False
		EndIf
	local $Result = DllCall($FFDllHandle, "BOOLEAN", "SaveBMP", "int", $NoSnapShot, "str", $FileNameWithNoExtension)
	If ((Not IsArray($Result)) OR $Result[0]<>1) Then
		SetError(1)
		Return False
	EndIf
	local $Suffixe = DllCall($FFDllHandle, "int", "GetLastFileSuffix")
	If (IsArray($Result)) Then
			$LastFileNameParam = $FileNameWithNoExtension+".BMP"
	EndIf
	return true
EndFunc
Das hab ich schon versucht. Es funktioniert nicht
Moneypulation is offline  
Old 07/31/2015, 02:01   #5
 
°Incinerate's Avatar
 
elite*gold: 400
Join Date: Jun 2011
Posts: 513
Received Thanks: 101
Soweit ich das sehe steckt dein Problem in der FastFind.dll.
Du kannst ja mal versuchen mit FileWrite den Inhalt der des Bildes zu löschen und mit FileMove in den Papierkorb schieben.
°Incinerate is offline  
Reply




All times are GMT +1. The time now is 01:58.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.