Hi,
I working on an image to Ascii Art project and so far so good, though a bit too slow when it comes to rather large images, but thats another issue. Anyway I’m trying to figure out how to color the text , approx to that of the image. So far it doesn’t color it. I may not have this right.
var st as new StyledText
For y = 0 To image.Height - 1
For x = 0 To image.Width - 1
c = image.RGBSurface.Pixel(x,y)//get color from image
nextColor =image.RGBSurface.Pixel(x+1,y)
//do some calculations , brightness & index here
.
.
.
.
textcount = textcount +1 // count the text so far for current color
St.Text = St.Text +asciiChars.Mid(index + 1, 1)
if c <> nextColor then //if next color is different, color the text so far to C
st.TextColor (start, textcount) = c
start = x
textcount = 0
end if
Next x
start = start + Y
St.Text =St.Text + EndOfLine
Next y
st.FontName(0,st.Text.Length) = "Courier New"
st.Size(0,st.Text.Length) = 4
TextArea1.StyledText = st
Thanks!