[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] building and Image





Simple image code does not seem to work in my version of 3.6, such as this from the Image help file:

(
j = Image.new(400,300);
j.lockFocus;
Pen.translate(100, 100);
1000.do{
        Pen.color = Color.green(rrand(0.0, 1), rrand(0.0, 0.5));
        Pen.addAnnularWedge(
                (100.rand)@(100.rand),
                rrand(10, 50),
                rrand(51, 100),
                2pi.rand,
                2pi.rand
                );
        Pen.perform([\stroke, \fill].choose);
};
j.unlockFocus;
)

 
And if you solve your platform problem notice that lockFocus is no implemented for guikit reasons, use draw instead (I guess is the right method now):

(
j = Image.new(400,300);
//j.lockFocus;
j.draw({
    Pen.translate(100, 100);
    1000.do{
        Pen.color = Color.green(rrand(0.0, 1), rrand(0.0, 0.5));
        Pen.addAnnularWedge(
            (100.rand)@(100.rand),
            rrand(10, 50),
            rrand(51, 100),
            2pi.rand,
            2pi.rand
        );
        Pen.perform([\stroke, \fill].choose);
    };
});
//j.unlockFocus;
)