Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Pass Image through shared Memory (including mutex)

Author
Message
RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 3rd Aug 2008 04:50 Edited at: 3rd Aug 2008 04:50
I just made 2 functions to Put an Image into shared memory and Read it from another app, without any files being used.

Just run the example twice, for the first press "P" and for the second (while first is still running) press "R" and then the same random image should appear on both screens =)

I quickly commented the example code, isnt the best commentation

oh and THIS NEEDS matrix1util (like all of my snippets )


anyways i dont know if this is faster/slower/easier/harder than using a temporary file, but now i know all about shared memory and mutex

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Aug 2008 20:52
Why do you write the x and y position for every vertex? Just write the width and height at the start and the just the colour data

An easier way, which preserves the image format, and is faster, is to use 'make memblock from image', then write the memblock data to the bank. To receive it, just create a memblock the same size as the bank, copy across the data, and use 'make image from memblock'

Yuor signutare was aresed by a deslyxic mud...
Curious? CLICK HERE!

Login to post a reply

Server time is: 2024-11-22 07:47:00
Your offset time is: 2024-11-22 07:47:00