Am I doing something wrong?
Xojo 2020R2.1
I get an image using an Imagebrowser.
Looks OK in the debugger.
I resize it by creating a new picture, and drawing into it.
That looks OK in the debugger.
Using RGBSurface to get pixels from it doesnt work so well.
I create a new picture and draw onto that using blocks of color , taken from RGBSurface.pixel values.
What I read (and then draw with) , has a very strong yellow cast.
Picture to illustrate:
Top is the imageloader dialog
Second picture is the picture I chose.
Third is how the new (reduced in size) image appears in the debugger.
Note that the whites are still whiteish.
Bottom right is the final image, created by drawing blocks using the color presented by RGBSurface
Looks like it has yellow plastic stuck over it!
My Code:
var rx,ry as integer
var c as color
rgbs = working_from_picture.rgbsurface
For rx =0 To working_from_picture.width -1
For ry = 0 To working_from_picture.height -1
Try
c= rgbs.pixel(rx,ry) //get color - this returns yellow for areas which are white/grey
c= Color.RGB(c.red,c.green,c.blue,0)
p3.Graphics.DrawingColor = c
p3.graphics.FillRectangle rx*4,ry*4,4,4
Catch
End Try
Next
Next