CODE: Transparencies and movements

Post Reply
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

CODE: Transparencies and movements

Post by Rochinha »

Friends,

Compile, run and click on left corner on top.

Here the code:

Code: Select all

/*
 *
 * *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
 * Descricao..: Modulo de PDV
 * Programador: Jose Carlos da Rocha
 * CopyRights.: 5Volution.COM
 * *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
 *
 */
#include "fivewin.ch"

#define SRCPAINT       15597702
#define SRCAND         8913094

function main()
   PUBLIC lNoPaint := .f.
   DEFINE BRUSH oBrush STYLE NULL
   DEFINE DIALOG oWnd TITLE "Transparence" SIZE 800,600 BRUSH oBrush STYLE WS_POPUP
                                        
   @ 0,0 BITMAP filename "" OF oWnd NOBORDER PIXEL SIZE 10,10 ON LEFT CLICK WindowMove()

   ACTIVATE DIALOG oWnd CENTERED ;
               ON PAINT ShowBmp( oWnd, "transpr1.bmp", "transpr2.bmp" ) ;
               VALID iif(MsgYesNo('Certeza?','Atencao'),.t.,.f.) 

function ShowBmp( oDlg, cBmp1, cBmp2 )
   local hDC  := oDlg:hDC
   local oBmp1, oBmp2
   DEFINE BITMAP oBmp1 FILENAME cBmp1
   DEFINE BITMAP oBmp2 FILENAME cBmp2
   DrawBitmap( hDC, oBmp2:hBitmap, 0, 0, 0, 0, SRCPAINT )
   DrawBitmap( hDC, oBmp1:hBitmap, 0, 0, 0, 0, SRCAND )
   oBmp1:End()
   oBmp2:End()
   return nil

function WindowMove()
   Do while GetKeyState(VK_LBUTTON)
      onde:=GetCursorpos()
      MoveWindow( oWnd:hWnd, onde[1], onde[2], 20, 20, .t. )
      SysRefresh()
      If !GetKeyState(VK_LBUTTON)
         Exit
      Endif
   Enddo
   MoveWindow( oWnd:hWnd, onde[1], onde[2], 800, 600, .t. )
   Return nil
Here the bitmaps:
http://www.5volution.com/forum/transpr.zip
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Rochinha,

have you tested it in Vista ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
richard-service
Posts: 583
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Post by richard-service »

Hi Rochinha,

In Vista OS, I saw it same transpr2.bmp

Regards,

richard
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Friends,

Yes, tested in Windows server 2003 and Windows Vista ultimate.

The bitmaps have a background diference.

Works fine.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Rochinha,

Could you please post a screenshot of it running in Vista ? Thanks

Here it is not working fine,
regards, saludos

Antonio Linares
www.fivetechsoft.com
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Here,

Image
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Here,

One more sample:

Download

Press a mouse on top and left corner to hide and move on screen.
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Attached a screen shot from my VISTA PC business.

The left is compiled on my PC the right is your exe.
Regards,
Otto


Image
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Rochinha,

Please notice in Otto's screenshots that the lower left corner is black.

Have you done some modifications in your classes ? Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply