[haiku-development] Hello, and a BBitmap question.

  • From: jkim202@xxxxxxxxxxxxxxxxx
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 24 May 2008 23:02:43 +1200

Hello Haiku developers!

My name is James and I have been working on a layout manager called ALM. In
particular, I have been porting it from original C# version. As you will see in
the lib directory, ALM is already available in Haiku. I am currently working on
porting an extension of ALM.

I need some help with converting a BControl (or BView) object, such as BButton,
to an image (BBitmap). For example, an image of BButton in a GUI needs to be
created and rendered in a window, replacing the original BButton. Obviously,
this rendered image would look the same as the original BButton, but it would
have no functionality because it is no longer a real button.

I have looked into BBitmap in bebook and also some drawing methods such as
BView::DrawBitmap(). After reading those documents, my initial thought was to
create a BBitmap object and then add a BView as a child and draw a BControl
inside that BView. If my understanding is correct, everything drawn inside
BBitmap's child BView is drawn onto BBitmap. But I don't know how to draw a
BControl inside the BView. I can add a BControl inside BView, but does that
mean that it is actually "drawing"?

For C# users, this is done using Control.DrawToBitmap() followed by
Graphics.DrawImage() methods. Is this possible in Haiku?

Thank you.


James Kim

Other related posts: