[Implemented] SaveImageToMemory()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

[Implemented] SaveImageToMemory()

Post by Joakim Christiansen »

Implemented as EncodeImage()

Just like our SaveImage() function, but saving it to the selected memory buffer and then return how much data was written. And it should support the image plugins...
:D
Wouldn't be hard would it?
I like logic, hence I dislike humans but love computers.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I asked for this a while back. I think it should automatically allocate the memory and return the location (memory id). You can then use the memory commands to find out how much memory was taken up.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I assume you do know you can this with api and a named pipe?
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Yes, but it would be nice as part of the command set for all versions. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Trond wrote:I assume you do know you can this with api and a named pipe?
I suspected that, never used a pipe though. But yeah, as DoubleDutch says; it would be nice to have in PB.
I like logic, hence I dislike humans but love computers.
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post by Deeem2031 »

Some time ago I posted this code to save a image to memory via pipes: http://www.purebasic.fr/english/viewtop ... 15&start=0
irc://irc.freenode.org/#purebasic
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Okay, I'll use the pipe method for now then. But it would be nice if they wrote this on their todo list since it's very simple to add.
I like logic, hence I dislike humans but love computers.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Any chances we can access to the image buffer natively one day :) ?

(I know we can do this through API).
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Post by LCD »

In the Code Archive (CAV) I found the CopyImageToMemory() and CopyMemoryToImage() Procedures which are both very useful, sadly they will work only in Windows (making porting to other systems impossible), so I'm voting too for native support in PureBasic for Linux and MacOS. This would be a nice replacement for Plotting on Image which is a bit Slow.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Post by LCD »

Thanks, but thats Windows only! Not Linux and not MacOS.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Please stop posting links of workarounds in a feature request, it's just nonsense.
I'd like it native, because even with those workarounds, we lose a lot of speed with useless memory manipulation.
Post Reply