Image fill question
Thierry Douez
th.douez at gmail.com
Tue Nov 4 14:48:50 EST 2014
Hi Hugh,
Quick and dirty but seems to work...
-- I assume your original image is already 10x10
-- next 2 lines: 0, R, G and Blue
put numtochar(0) & numtochar(178) & numtochar(150) & numtochar(255)
into myColor
put numtochar(0) & numtochar(0) & numtochar(0) & numtochar(0) into
myBorderColor
repeat with i=0 to 99
if i < 10 then get myBorderColor
else if i > 90 then get myBorderColor
else if i mod 10 is 0 then get myBorderColor
else if i mod 10 is 9 then get myBorderColor
else get myColor
put IT after T
end repeat
set the imageData of image 1 to T
Is it fast enough?
Regards,
Thierry
------------------------------------------------
Thierry Douez - http://sunny-tdz.com
Maker of sunnYperl - sunnYmidi - sunnYmage
2014-11-04 19:20 GMT+01:00 FlexibleLearning.com <admin at flexiblelearning.com>:
> I have a 10px x 10px image. There is a 1px black border with a colour fill.
>
> How do I set the colour fill of the image using an arbitrary RGB value?
>
> It needs to be a mathematical approach setting the pixel data directly
> (taking and applying a screen shot of a graphic is going to be too slow).
>
> I've tried all sorts and failed miserably... Can anyone help with this
> challenge?
>
> Hugh Senior
> FLCo
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list