GrabImage should have Clipping

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

GrabImage should have Clipping

Post 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.
地球上の平和
BarryG
Addict
Addict
Posts: 3330
Joined: Thu Apr 18, 2019 8:17 am

Re: GrabImage should have Clipping

Post 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?
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: GrabImage should have Clipping

Post 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.
地球上の平和
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: GrabImage should have Clipping

Post by #NULL »

I get the runtime error on linux.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: GrabImage should have Clipping

Post 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.
地球上の平和
Post Reply