Page 1 of 1
GrabImage should have Clipping
Posted: Wed Oct 14, 2020 1:43 pm
by Saki
GrabImage should have a clipping.
Under all OS it will crash at values <0.
Values higher than max will not cause a crash on Windows and Mac, on Linux the GUI will also crash completely, even if the debugger is turned on.
Re: GrabImage should have Clipping
Posted: Wed Oct 14, 2020 1:54 pm
by BarryG
Saki wrote:Under all OS it will crash at values <0
Doesn't crash here with <0 values (Win 10 Pro, 32-bit PureBasic version 5.72):
Code: Select all
CreateImage(0,640,480)
Debug GrabImage(0,1,-1,-1,-1,-1) ; Runtime error: "The specified 'X' is negative"
Got a snippet to demonstrate the problem?
Re: GrabImage should have Clipping
Posted: Wed Oct 14, 2020 3:28 pm
by Saki
Hi Barry, I think it's not needed.
Primary Linux like it not.
This function should work similar Box(), simple all over Bulletproof and on all OS at the same.
It is senseless i must ever set self a primary mostly needed clipping.
Re: GrabImage should have Clipping
Posted: Wed Oct 14, 2020 3:40 pm
by #NULL
I get the runtime error on linux.
Re: GrabImage should have Clipping
Posted: Wed Oct 14, 2020 4:03 pm
by Saki
Hi, thanks for your Hint.
Have you tested with oversize on Linux ?
Because, it is available you are right.
I use Linux with a VM, this works to 99.9%, but it can create also 0.1% strange effects.
But, a automatically clipping is needed !
GrabImage cuts out areas of an image.
What lies outside the image is absolutely irrelevant and should be clipped automatically.
Under Linux there is an offset of one pixel.
So GrabImage for Linux is incompatible to the other OS.
This should also be adjusted, because it leads also to crashes without a working clipping.