[interfacekit] Re: Drawing IDEA
- From: "Marc Flerackers" <mflerackers@xxxxxxxxxx>
- To: <interfacekit@xxxxxxxxxxxxx>
- Date: Tue, 2 Sep 2003 15:02:36 +0200
> Hello you hard working guys! :-)
>
> Listen, a fellow of us, Simon Taylor posted a message on openbeos mail
> list about a new visual design for R1. I FULLY sustain his POV.
> So, I looked
> at the images he showed us and decided myself to make a decorator based on
> the GUI concept made by our CDT leader Stuart.
I know there are lots of nice designs out there, but I think that for now we
should focus on stability and getting something finished :)
> While studying that concept, I observed it used gradients for
> almost all
> the components. I do like that, gradient fills look nice. So, I began to
> wonder, can BeOS API do gradients?
> Well... I looked into BeBook and, I was a bit surprised to
> find out that
> BeAPI does not support gradients! Actually the Drawing API is very old and
> lacks A LOT of features - that's why Marc said that we shall have a major
> D.API redesign for R2.
Be suggests using the BeginLineArray, AddLine, EndLineArray to draw
gradients. They mentioned once that the line data is transferred by shared
memory, however this is not true for R5. The drawback (even if you use
shared data) is of course that you have to call lots of times AddLine, that
it works best for horizontal/vertical gradients and that you can't dither
them nicely. They use it for example for the color control. you can fill
freeform shapes by using clipping.
For more elaborate gradients, you can render the gradient into a bitmap
(which is shared anyway), and draw the bitmap, I guess it won't matter much
in speed whether you do this or have gradients rendered server side (as long
as no acceleration is used). Again you can clip the output to render a
gradient filled shape.
I looked at lots of drawing API's to find a good way to define gradients,
and they all quite fail at it. Sure they support the most obvious gradients,
but none gives you full power. I guess defining vertices with colors is
still the most powerful, but you'll have problems making curved gradients.
I guess the best way for now would be to make a BGradientRenderer separate
from BView, which just renders into a bitmap(s) and draws them into the
view. Later we can see how to make a powerful and not too restrictive API
for them which we can integrate into BView.
Marc Flerackers
- References:
- [interfacekit] Drawing IDEA
- From: Adi Oanca
Other related posts:
- » [interfacekit] Drawing IDEA
- » [interfacekit] Re: Drawing IDEA
- » [interfacekit] Re: Drawing IDEA
- » [interfacekit] Re: Drawing IDEA
- » [interfacekit] Re: Drawing IDEA
- [interfacekit] Drawing IDEA
- From: Adi Oanca