Page 1 of 1
Feature request for drawing process.
Posted: Sun Apr 03, 2022 11:46 am
by ZX80
Hello, all.
I know it's not possible right now, but is it possible to add this in future?
Code: Select all
If CreateImage(0, w, h) And CreateImage(1, ww, hh)
If StartDrawing(ImageOutput(0))
...
If StartDrawing(ImageOutput(1))
...
StopDrawing(1)
EndIf
...
StopDrawing(0)
EndIf
EndIf
Goal: during scan of image #1 I want to generate image #2 (from part of image data #1). On the fly, without intermediate buffers.
Re: Feature request for drawing process.
Posted: Sun Apr 03, 2022 12:10 pm
by jacdelad
Im working on a module for stacked StartDrawing, but I encountered numerous hurdles. But maybe it's worth continuing this project if Fred doesn't implement it natively.
Re: Feature request for drawing process.
Posted: Sun Apr 03, 2022 12:52 pm
by ZX80
@jacdelad
Thanks for your reply. It's too bad, that's hard to do. I was hoping to see this in the near future.
P.S. I watch the news about new versions of PB and see the work on the graphics. So I thought...
Re: Feature request for drawing process.
Posted: Sun Apr 03, 2022 1:20 pm
by STARGÅTE
How should it work?
How functions like Plot(), Point(), Line(), etc. should behave?
Then all these functions need an additional parameter of the drawing scope.
Code: Select all
If CreateImage(0, w, h) And CreateImage(1, ww, hh)
*Output0 = StartDrawing(ImageOutput(0))
If *Output0
...
*Output1 = StartDrawing(ImageOutput(1))
If *Output1
...
Plot(*Output0, X, Y, Point(*Output1, X2, Y2))
...
StopDrawing(*Output1)
EndIf
...
StopDrawing(*Output0)
EndIf
EndIf
Re: Feature request for drawing process.
Posted: Sun Apr 03, 2022 1:48 pm
by infratec
As you can read in the help of StartDrawing(), it is possible by using threads.
Re: Feature request for drawing process.
Posted: Mon Apr 04, 2022 6:01 am
by jacdelad
I think using threads is a bad idea for just wanting to use a stackable StartDrawing(). At least the way I use it.
Re: Feature request for drawing process.
Posted: Mon Apr 04, 2022 7:01 am
by JHPJHP
Hi ZX80,
ZX80 wrote:Goal: during scan of image #1 I want to generate image #2 (from part of image data #1). On the fly, without intermediate buffers.
Playing around with this idea, but trying to keep it simple:
-
Windows Services & Other Stuff\Other_Stuff\DrawingBuffer\Array.pb, GrabImage.pb
NB*: Comparing the two, GrabImage is over twice as fast as the Array method; see title bar for elapsed time in milliseconds.
Re: Feature request for drawing process.
Posted: Mon Apr 04, 2022 1:27 pm
by ZX80
@
JHPJHP
Thanks for your example. I'll see, but most likely I will use an arrays list. I think this is the best solution for my case.
@
jacdelad
I think using threads is a bad idea for just wanting to use a stackable StartDrawing().
Yes, it will unnecessarily complicate the process.
@
STARGÅTE
I don't know. That's why I asked. Yes, probably you are right about additional parameter.
Thanks everyone.