Feature request for drawing process.

Just starting out? Need help? Post your questions and find answers here.
ZX80
Enthusiast
Enthusiast
Posts: 361
Joined: Mon Dec 12, 2016 1:37 pm

Feature request for drawing process.

Post 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.
User avatar
jacdelad
Addict
Addict
Posts: 1992
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Feature request for drawing process.

Post 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.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
ZX80
Enthusiast
Enthusiast
Posts: 361
Joined: Mon Dec 12, 2016 1:37 pm

Re: Feature request for drawing process.

Post 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...
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Feature request for drawing process.

Post 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
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
infratec
Always Here
Always Here
Posts: 7578
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Feature request for drawing process.

Post by infratec »

As you can read in the help of StartDrawing(), it is possible by using threads.
User avatar
jacdelad
Addict
Addict
Posts: 1992
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Feature request for drawing process.

Post 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.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
JHPJHP
Addict
Addict
Posts: 2251
Joined: Sat Oct 09, 2010 3:47 am

Re: Feature request for drawing process.

Post 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.
Last edited by JHPJHP on Thu Apr 07, 2022 3:21 pm, edited 6 times in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
ZX80
Enthusiast
Enthusiast
Posts: 361
Joined: Mon Dec 12, 2016 1:37 pm

Re: Feature request for drawing process.

Post 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.
Post Reply