Go to the FreeLists Home Page Home Signup Help Login
 



[openbeos] || [Date Prev] [02-2002 Date Index] [Date Next] || [Thread Prev] [02-2002 Thread Index] [Thread Next]

[openbeos] Re: Problems with pictures.

  • From: "Ithamar R. Adema" <ithamar@xxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sat, 2 Feb 2002 13:56:03 +0100
Hi,

>// Add the key icon
>BBitmap *icon_bitmap = BTranslationUtils::GetBitmap("key_bmap");
>DrawBitmap(icon_bitmap,BPoint(0,0));
>Invalidate(icon_bitmap->Bounds());

I assume this code isn't in the Draw() method of a BView subclass? If 
it is, the Invalidate should go :) All drawing should happen in the 
Draw() method, and you could call Invalidate() on the view at any time 
you want the view (or part of the view) to redraw. However, in most 
cases the view will redraw at the right time anyway. It would only be 
needed when you change the bitmap that you want to draw....

So, create a "MyView" subclass of "BView", read the bitmap from the 
resources in the constructor for example, and override the Draw() 
method to call DrawBitmap(). If you add the view to a window, and 
create and show the window in ReadyToRun() for example of your 
"BApplication" subclass, you'll see the window with the view displaying 
the bitmap as soon as you start the app.

Regards,

Ithamar.

PS: This would be a message to send to the bedevtalk list really :)







[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.