FastImageOutput

Share your advanced PureBasic knowledge/code with the community.
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: FastImageOutput

Post by Michael Vogel »

Hm,
I just took an old code (Trax and tried to compile it under 4.50. When starting the exe, I get an invalid memory access (read error at address 48), which was not here with PB4.31. I will check my code if I can bring up a small snippet demonstrating the problem, but maybe there are some hints what could got wrong?!

Thanks,
Michael

Code: Select all

		CopyImage(#ClrBoard,#FixBoard)
		FixBoard=ImageID(#FixBoard)

		Debug FixBoard;				67439849
		Debug ImageWidth(#FixBoard);		440
		Debug ImageHeight(#FixBoard);		420
		Debug ImageDepth(#FixBoard);		24
		
		StartDrawing(FastImageOutput(#FixBoard))
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: FastImageOutput

Post by Fred »

FastImageOutput() is broken with 4.50 as it relies on internal structure which is plain hacking and not supported. Just use the standard ImageOutput() and it should be fast as well.
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: FastImageOutput

Post by Michael Vogel »

Fred wrote:FastImageOutput() is broken with 4.50 as it relies on internal structure which is plain hacking and not supported. Just use the standard ImageOutput() and it should be fast as well.
Thanks for the information, changed the code...

Code: Select all

CompilerIf #PB_Compiler_Version>431

	Macro FastImageOutput(a)
		ImageOutput(a)
	EndMacro

CompilerElse

	Procedure ___ReleaseFastImageOutput()
	Procedure ___StopDirectAccess()
	Procedure ___StartDirectAccess()
	Procedure FastImageOutput(Image)

CompilerEndif
Post Reply