Setting Pixels - More answers to suggestions
Monte Goulding
monte at sweattechnologies.com
Thu Jan 30 11:08:01 EST 2003
Hi All
I never read the original problem but I just made a custom paint tool with
this:
-- button script
on mouseUp
InitialiseImageData
InitialisePaintColor
end mouseUp
-- card script
local lImageData,lPaintColor,lMouseDown
on InitialiseImageData
put the imageData of image 1 into lImageData
end InitialiseImageData
on InitialisePaintColor
put binaryEncode("CCCC",0,0,255,0) into lPaintColor
end InitialisePaintColor
on mouseMove x,y
if lMouseDown then
if word 1 of the target is "image" then
set the lockCursor to true
set the cursor to cross
put (x-the left of image 1)*4+(y- the top of image 1)*(the width of
image 1*4) into x
put lPaintColor into char x-3 to x of lImageData
set the imageData of image 1 to lImageData
end if
else
pass mouseMove
end if
end mouseMove
on mouseDown
put true into lMouseDown
end mouseDown
on mouseUp
put false into lMouseDown
end mouseUp
on mouseRelease
put false into lMouseDown
end mouseRelease
Hope you like drawing squigly lines ;-)
Monte
More information about the use-livecode
mailing list