Get color of a Pixel in a Bitmap with ruby

For general discussion related FlowStone
Post Reply
User avatar
chackl
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Get color of a Pixel in a Bitmap with ruby

Post by chackl »

Hello!

Is ist possible to get the color of a Pixel in a Bitmap with ruby - I know there is a primitive - but it is so slow :/

Best Regards,
C.Hackl
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Get color of a Pixel in a Bitmap with ruby

Post by trogluddite »

AFAIK, there's no way to access any of the data inside the bitmap. My guess is that Ruby is just using a pointer to the bitmap memory that gets passed straight to GDI+, just reading the header to get the size information - that would also explain why the Ruby bitmap data can't be saved between sessions, as the memory location would be different every time.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
chackl
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: Get color of a Pixel in a Bitmap with ruby

Post by chackl »

So i guess here is a big workaround needed.
I experimented today with some basic fst primitives. I hope i will get a working solution.
Regards
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
Post Reply