FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How refresh a bitmap into dialog
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
How refresh a bitmap into dialog
Posted: Wed Mar 26, 2008 09:03 AM
  #Include "FiveWin.Ch"

Static oDlg,oBmp


FUNCTION Main()
   LOCAL oFont

   LOcal  cBitmap:= "c:\fwh\bitmaps\blinker1.bmp"    // sample bitmap
   
   DEFINE FONT oFont NAME GetSysFont() SIZE 0, -8

   DEFINE DIALOG oDlg SIZE 255, 245 TITLE "TEst BITMAP" FONT oFont





   ACTIVATE DIALOG oDlg CENTERED             ;
   on Paint Start(cBitmap)                  ;
   ON INIT   oDlg:SetMenu( Menudlg(oDlg))



   RETURN (Nil)

Function Start(cBitmap) 

// Bitmap
      oBmp:=TBitmap():Define( , cBitmap, oDlg )
      PalBmpDraw(oDlg:hDC,0,0,oBmp:hBitmap,oBmp:hPalette,oDlg:nWidth,oDlg:nHeight)

return nil

Function Menudlg(oDlg)
     Local oMenu
    MENU oMenu 2007
       MENUITEM  "Insert Bitmap "
          MENU
             MENUITEM  "First Bitmap "  action (cbitmap:="c:\fwh\bitmaps\blinker1.bmp",odlg:refresh())
             MENUITEM  "Second Bitmap " action (cbitmap:="c:\fwh\bitmaps\blinker2.bmp",odlg:refresh())

          ENDMENU
ENDMENU



How I can refresh the bitmap into dialo g?
Best Regards, Saludos



Falconi Silvio
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How refresh a bitmap into dialog
Posted: Wed Mar 26, 2008 05:57 PM

Silvio,

You should not do it that way, as you are creating a new bitmap every_time the dialog is painted!

Create the bitmap just once and then later on, change the image using:
oBmp:LoadBMP( cBmpFile )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Refresh Bitmaps
Posted: Fri Mar 28, 2008 11:19 AM

Hello Silvio,

exactly that i had to do in the new designer-update.
Im using just one bitmap from resource
and do a new paint on the bitmap with colors,
brushes, everything i need.
You can see it on the bottom of the gradient-creation.
There are 2 Bitmaps : 1 with start-color and 2. with end-color.
They change every time, when i choose different colors.

Regards

Uwe

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion