[Gambas-user] DrawingArea Problem

juelin juergen.linder at ...17...
Mon Jun 1 18:06:56 CEST 2009


hello,
I wrote a program where I drawing 2 lines and read the images.
first I draw a first line from x=6 and y=6 to x=517 and y=517
then I call function read_pixel
then I call funftion clear_area
then I draw a second line x=6 and y=517 to x=517 and y=6
then I call function read_pixel
But after that in the DrawingArea the first line AND second line is inside
(at read_pixel)
Why function clear_area do not work?
have anybody an idea what happens?
kind regards

STATIC PRIVATE sifig AS Image      
PUBLIC SUB clear_area()
  DIM x AS Integer
  DIM y AS Integer
  DrawingArea1.BackColor = 0
  DrawingArea1.ForeColor = 0
  DrawingArea1.Clear
  Draw.Begin(DrawingArea1)
    Draw.Transparent = FALSE
    Draw.FillStyle = 1
    Draw.LineStyle = 1
    Draw.BackColor = 0
    Draw.ForeColor = 0
    FOR x = 6 TO 517 STEP 1
      FOR y = 6 TO 517 STEP 1
        Draw.Point(x, y)
      NEXT 
    NEXT 
  Draw.End
  DrawingArea1.Refresh
  WAIT 
END   
PUBLIC SUB read_pixel()
  DIM x AS Integer
  DIM y AS Integer
  DIM f AS Integer
  FOR y = 6 TO 517 STEP 1
    FOR x = 6 TO 517 STEP 1
      f = sifig[x, y]
    NEXT
  NEXT
END
Draw.Begin(DrawingArea1)
   Draw.Transparent = FALSE
    Draw.FillStyle = 1
    Draw.LineStyle = 1
    Draw.ForeColor = &H0000FF
    Draw.Line(6, 6, 517, 517)
Draw.End
DrawingArea1.Refresh
WAIT 
sifig = DrawingArea1.Grab().Image
read_pixel
clear_area
Draw.Begin(DrawingArea1)
   Draw.Transparent = FALSE
    Draw.FillStyle = 1
    Draw.LineStyle = 1
    Draw.ForeColor = &H0000FF
    Draw.Line(6, 517, 517, 6)
Draw.End
DrawingArea1.Refresh
WAIT 
sifig = DrawingArea1.Grab().Image
read_pixel

-- 
View this message in context: http://www.nabble.com/DrawingArea-Problem-tp23817487p23817487.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list