I think I found what I was doing wrong... I was calling SetOpacity(). This was lowering the opacity of everything in the window including the text.

Mark


Mark Horton wrote:
Here's a code snippet I'm using (mostly taken from df_window.c):

  DFBWindowDescription desc;
  desc.flags  = ( DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH |
                  DWDESC_HEIGHT | DWDESC_CAPS );
  desc.posx   = 200;
  desc.posy   = 200;
  desc.width  = 400;
  desc.height = 300;
  desc.caps   = DWCAPS_ALPHACHANNEL;

  DFBCHECK(layer->CreateWindow( layer, &desc, &window ) );
  window->GetSurface( window, &window_surface );

  window_surface->SetColor( window_surface, 0xFF, 0x20, 0x20, 0x90 );
  window_surface->DrawRectangle( window_surface, 0, 0,
                                 desc.width, desc.height );

window_surface->SetDrawingFlags( window_surface, DSDRAW_NOFX );

  window_surface->SetColor( window_surface, 0x00, 0x00, 0x00, 0xff );
  window_surface->DrawString( window_surface, "Earth",
                              -1, 10,10, DSTF_LEFT | DSTF_TOP );

window_surface->Flip( window_surface, NULL, 0 );

Am I on the right track? Or is this completely wrong?

I thought by setting DSDRAW_NOFX to the surface would make the text opaque, but it doesn't. This is the first graphics related programming I've done so there's a good chance I'm doing something fundamentally incorrect.

MDH


Sven Neumann wrote:


Hi,

Mark Horton <[EMAIL PROTECTED]> writes:


I have a IDirectFBSurface that I'm drawing some text
on.  The surface is in a IDirectFBWindow.  If I set
the window's opacity I can make the window
translucent.  This works perfectly.

Is it possible to have the text on the surface stay
opaque but the rest of the surface translucent? Perhaps I should create 2 windows? One with the text
and one with the translucent color?



You will need to use a window with alphachannel, fill it with translucent background and draw opaque text on it.


Sven










--
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe directfb-dev" as subject.




Reply via email to