Allias Nicolas wrote:
>> what is a "gum"?
> 
> Huh, sorry, I meant a rubber (same word in French)

ahh -- that would be an "eraser" in American English.

> I want to change the values of the image's pixels rubbed, so i should take the
> whole rubbed pixels or merge the added lines with the bitmap ?
> I didn't saw any rubber example on floatcanvas. Any idea ?

No, I don't think there is an example of that. However, I'm a bit 
confused -- FloatCanvas is primarily a vector graphics tool, not a 
bitmap graphics tool. IN general, the final image is made up of a bunch 
of DrawObjects that are defined mathematicially, and rendered at a given 
scale when desired, so you don't' usually manipulate the pixels, but 
rather the definition of the DrawObjects, and let FloatCanvas manipulate 
the pixels for you.

This can get a bit confused, and one type of DrawObject is a 
ScaledBitmap, which is made up of pixels. If you want to use your "gum" 
on a ScaledBitmap (or regular Bitmap), then you need to be manipulating 
the pixels of that bitmap, rather than FloatCanvas' buffer. Depending on 
how you put your ScaledBitmap on the canvas, it may be tricky to figure 
out which pixels you want.


>> That's what InForeground is for.
> 
> is it a function or an attribute ?

It is an attribute of a DrawObject, and it is set when you put the 
Object on the Canvas, depending on the value of the InForeground parameter.


> The shorter I can:

I don't have time right now to look through this, but:


> in UpdateScreen I resize all added lines, but I want to resize in function of
> the thickness of each lines.. not with the last thickness, is there a  
> way to get
> each line thickness, in order to :
> item.SetLineWidth(item.GetlineWidth()*self.parent.Scale) ?

It looks like you want the LineWidth to scale with the whole drawing? 
The behavior of the Default Line object is to stay the same width as you 
zoom -- this is because to use it to represent data, that is often 
desirable -- at least it was for my uses!

To do this, you want to make a new DrawOBject, probably derived from 
FloatCanvas.Line, and change its _draw attribute to scale the line 
thickness. Take a look at ScaledTextBox for an example you can borrow 
from -- there the font size is scaling, which would be similar to a 
linewidth scaling.

-Chris






-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[EMAIL PROTECTED]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to