Image Manipulator coordinates

For questions about using Classic.

Post » Mon Jun 08, 2009 7:14 am

I've been trying to understand how to retrieve the R/G/B values at a specific point in an image.

Here is a link to what I'm trying to do
http://dl.getdropbox.com/u/1024727/canvas2.cap

The canvas transfers its image (which is the size of the layout) to the image manipulator.
Yet the image manipulator doesn't retrieve the correct RGB values at the location it should be placed in the image.

Anyone have any ideas how to retrieve RGB values accurately from an image?
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Mon Jun 08, 2009 10:16 am

You found a bug, there's something wrong with canvas' private variables. Ill let you post it to the tracker. Beyond that Im afraid this will never work very well, as it has to get the information from the gpu. So you would need a "buffer" for the pasting, but you would need one in between each time it got rgb, and set it to text. If you really want to do it, I'd suggest using global variables, or a delayed function. Plus there might be something wrong with canvas as well, not sure but its size is acting wierd, you have to manually set it or it always goes back to 256.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Mon Jun 08, 2009 10:51 am

yeah it did seem a bit buggy, just wasn't sure. I'm not sure how I'd post this on the tracker, you seem to have a better understanding of the problem than me.


edit: I tried using functions, which has better results. Although I think there must be a problem with retrieving the RBG coordinates.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Mon Jun 08, 2009 11:19 am

Here's what Im getting, like I said it works some of the time, the rest of the time its returning 0.

[url:g036bgyr]http://dl.getdropbox.com/u/666516/cantest.cap[/url:g036bgyr]

Edit: I think what your going to have to do is have something like a swap file. If you make up a loop and have image manipulator compare rgb for each pixel, then write that data to an array you wouldn't have to get the data from memory, and you could have the color check in real time.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests