FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour UNA SOBRE BRUSH
Posts: 330
Joined: Fri May 25, 2007 09:06 PM
UNA SOBRE BRUSH
Posted: Mon Feb 08, 2010 07:09 PM

tengo la siguiente DUDA::

DEFINE WINDOW oWnd BRUSH oBrush

como se podria cambiar el oBrush de esta ventana principal en tiempo de ejecucion..

oBrush es un file .bmp

Gracias..

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: UNA SOBRE BRUSH
Posted: Mon Feb 08, 2010 08:17 PM

Mantonio,
Yo apenas estoy apenas aprendiendo a programar, pero talvez funcionaria:

oBrush:cBmpFile := new.bmp

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: UNA SOBRE BRUSH
Posted: Mon Feb 08, 2010 11:31 PM

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: UNA SOBRE BRUSH
Posted: Tue Feb 09, 2010 01:07 AM
Mantonio,

Code (fw): Select all Collapse
local oBrush1, oBrush2

DEFINE BRUSH oBrush1 FILENAME "test1.bmp"

DEFINE BRUSH oBrush2 FILENAME "test2.bmp"

DEFINE WINDOW oWnd BRUSH oBrush1

...

oWnd:SetBrush( oBrush2 )
oWnd:Refresh()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 330
Joined: Fri May 25, 2007 09:06 PM
Re: UNA SOBRE BRUSH
Posted: Sat Feb 13, 2010 02:23 PM

MASTER ANTONIO..

COMO APLICO EN TIEMPO DE EJECUCION EL CAMBIO DE BRUSH Q DESEO HACER.. lo he puesto en ON PAINT de la ventana principal.. y no corre..

como y dnd habria q aplicarlo::

GRACIAS

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: UNA SOBRE BRUSH
Posted: Sat Feb 13, 2010 05:18 PM
Mantonio,

Code (fw): Select all Collapse
DEFINE BRUSH oBrush FILE ltrim(RUTA+'\tapiz\mar1.bmp')
 

Ventanaprin:bPainted := {|hDC| PalBmpDraw( hDC, 40, 0, oBrush:hBitmap,, Ventanaprin:nWidth, Ventanaprin:nHeight,, .T.) }


y desde la funcion con la que cambies el tapiz, vuelve a difinir el Brush con el mismo nombre:

Code (fw): Select all Collapse
DEFINE BRUSH oBrush FILE ltrim(RUTA+'\tapiz\mar2.bmp')

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: UNA SOBRE BRUSH
Posted: Sun Feb 14, 2010 07:06 PM
Teniendo el nuevo brush creado, puedes llamar a este código desde donde desees:
Code (fw): Select all Collapse
oWnd:SetBrush( oBrush2 )
oWnd:Refresh()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 364
Joined: Tue Oct 25, 2005 07:06 PM
Re: UNA SOBRE BRUSH
Posted: Mon Feb 15, 2010 01:46 AM

no va en el activate como on paint, va sencillamente al definir la ventana, luego si se cambia en tiempo de ejecucion seria como en una funcion algo asi:

dire= GETENV("USERPROFILE")+"\Mis documentos\Mis imágenes"
gcFile:= cGetFile32( "BITMAP (.bmp)| .bmp|" , "Seleccione un archivo de Imagen",3, dire)
DEFINE BRUSH dibujo file GCFILE
owindows:oBRUSH(dibujo)
owindows:refresh()

y por supuesto las respectivas validaciones de si selecciono un archivo, etc,etc

Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217

Continue the discussion