SRL Archive - Help and Support

TCanvas.Pixels


almost

2011-04-14 15:08:27

I need to make an array that is exactly like TCanvas.Pixels
Pixels has an x and a y value (an array of an array of integer I suppose?) that give you a final value, the color of the pixel at (x, y).

I can do something like this-
var
Points: array of array of integer;

But it is different because you have to use it like Points[x][y]:= a;
But Pixels is used like Pixels[x, y]:= a;
Is there a way to make it like Pixels?
My main issue is setting the array lengths.
I have to do
SetArrayLength(Points, 100);
for i:= 0 to High(Points) do
SetArrayLength(Points[i], 100);
This is very inefficient when using large arrays and having to continuously set their sizes.
I need a way to basically set the first array size, then have every array of that array to be the same size.

Gu3st...

2011-04-14 15:18:10

SCAR or SIMBA?

You could do DrawTPABitmap then SafeDrawBitmap or some other DrawBitmap that draws to a canvas..

What is this for? Fractal drawer or 3d or what?

Wizzup?

2011-04-14 15:32:05

From: Zyt3x
SCAR or SIMBA?


That doesn't matter, they use the same interpreter. But since he's using Simba code tags I assume Simba.

AFAIK he just wants the syntatical sugar [x, y] instead of [x][y]. I don't know how to do this. Wait for nielsie, he may have a better answer. :)

almost

2011-04-14 15:46:15

Zyt3x you will like what this is for =)
It is 3D fractal related.
I'm in the process of creating a planet using a fractal.

I found a way to set the array lengths though, if you know the size of the arrays when you create them you can do
Points:= array [0..x] of array [0..x] of integer;
Me wanting the [x, y] form over the [x][y] form is purely for how it looks and just curiosity though.

Gu3st...

2011-04-14 15:49:36

From: almost
Zyt3x you will like what this is for =)
It is 3D fractal related.
Ah! That's what I guessed actually :D
I could help you with this by the way.. I've made several 3D engines in Simba :) Got msn?

almost

2011-04-14 16:48:14

Ok cool I'd like to see another 3D engine to compare to mine.
I don't have msn though but we can work something out