Re: grid



another thing regarding the grid function: the color should better be
a RGBA value and not GdkColor in order to be able to make the grid
transparent.

On Wed, Sep 17, 2008 at 10:21 PM,  <z pekar gmail com> wrote:
> Thank you Damon,
>
> I'll try to explain what I need it for so it might bring more clear
> view of the matter.
> I have an ultrasound image where I have to mark certain areas; once
> the image is clicked I put a small circle on that place.
> I need the grid/GtkRulers in order to make positioning(/reading
> coordinates of already placed markers) more accurate and reality tied.
> I think this kind of things are pretty generic and common to
> scientific applications. So the API could look smth. like this:
>
> GooCanvas *place_grid(GooCanvas canvas, GdkColor color, gdouble x,
> gdouble y, /* GtkRulers specific stuff */);
>
> returns a GooCanvas * - canvas with the grid on it
>
> canvas - canvas to place the grid on
> color - color of the grid
> /* GtkRulers specific stuff */
> x, y - marks on the horizontal and vertical rulers that correspond to
> canvas's corners
> (where x should corespond to canvas's top right corner, and y to its
> left bottom corner; and in a case where canvas(surrounded by rulers,
> with the grid upon it) is smaller than the widget it is packed into in
> expanded manner - the canvas should be enlarged proportionally in
> order to fit completely either horizontally or vertically (depending
> on which scaling factor is smaller in order not to loose the
> proportions) and the ruler of the opposite dimension should be
> continued until it fills the widget.
> For example if the vertical scaling factor turns to be smaller than
> the horizontal one - we enlarge the canvas both verticaly and
> horizontally by the vertical scaling factor - then left bottom corner
> would correspond to y and it will be the edge of the widget, and
> horizontally there will be free space, so the top right corner should
> correspond to x, but then the ruler will continue to the right with
> x+1, x+2, etc until it reachs the end of the widget.
>
> I hope despite my bad English you'll understand what I mean :)
>
> and thank you again!
>
> On Wed, Sep 17, 2008 at 3:27 PM, Damon Chaplin
> <damon karuna eclipse co uk> wrote:
>>
>> On Tue, 2008-09-16 at 21:25 +0300, z pekar gmail com wrote:
>>> On Mon, Sep 15, 2008 at 11:56 AM, Damon Chaplin
>>> <damon karuna eclipse co uk> wrote:
>>> >
>>> > On Thu, 2008-09-11 at 17:45 +0200, Murray Cumming wrote:
>>> >> On Thu, 2008-09-11 at 17:35 +0300, z pekar gmail com wrote:
>>> >> > Hi,
>>> >> > I have a GooCanvasImage with GooCanvasEllipse being added and removed
>>> >> > from it. I need to place a grid on all this stuff in order to make
>>> >> > placing of GooCanvasEllipse upon the image more accurate. What is the
>>> >> > best way to do it? - draw it with paths or maybe use tables somehow?
>>> >> > thank you
>>> >> > Z. Pekar
>>> >>
>>> >> I did this with lines.
>>> >>
>>> >> Using C++ (and some awkward multiple inheritance) I created a whole
>>> >> heirarchy of canvas items that can snap to the grid, or to rules. That's
>>> >> in Glom. for its (unfinished) print layouts. If you are using C then
>>> >> it's probably not that useful to you, but maybe it helps to know that
>>> >> somebody else has done this.
>>> >>
>>> >> I think this kind of high-level functionality should be in a library
>>> >> really.
>>> >
>>> > I think it might be difficult to come up with an API that everyone is
>>> > happy with - it could be a bit too application-specific.
>>> so maybe to find some common denominator and leave the rest to the programmer.
>>>
>>>
>>> > Though demo code would be useful, or items that can be easily subclassed
>>> > so they can be customized to suit a particular application.
>>> does this mean we have a hope(i.e. you'll give it a try)?
>>
>> I might do a simple grid item, but probably not much more. But someone
>> else might have a go.
>>
>> If people listed their particular requirements that might help. I don't
>> really have a clear idea of what people need.
>>
>> Damon
>>
>>
>>
>


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