Brush
Posted:
Thu Apr 18, 2024 6:06 pm
by oliveiros junior
Good afternoon everybody,
I would like to know if it is possible to define the size of the Brush on a dialog? I saw examples here with DrawImage. However, I need to place other images over the background image. I did a test by placing a background with DrawImage and other images on top, but the images are solid and not transparent on the background.
Thank you in advance for your help.
Att.,
Oliveiros Junior
Re: Brush
Posted:
Thu Apr 18, 2024 8:03 pm
by Antonio Linares
Estimado Oliveiros,
Puedes mostrar una imagen del efecto que deseas conseguir ? gracias
Re: Brush
Posted:
Fri Apr 19, 2024 12:00 pm
by karinha
Oliveiros, usando BITMAP, não serve? Você pode por quantas quiser e com o tamanho que quiser e transparente. Já tentou? E sempre que possível, poste um exemplo da ideia que você imaginou.
¿Oliveiros, usando BITMAP, no funciona? Puedes tener tantos como quieras y del tamaño que quieras y transparentes. ¿Ya probado? Y siempre que sea posible, publica un ejemplo de la idea que se te ocurrió.
Tks.
Regards, saludos.
Re: Brush
Posted:
Fri Apr 19, 2024 12:46 pm
by karinha
Oliveiros, no exemplo do relógio, diga o que te falta? ou que você precisa. Seja mais específico na questão, pls.
https://imgur.com/M00X1LTRegards, saludos.
Re: Brush
Posted:
Fri Apr 19, 2024 1:42 pm
by oliveiros junior
Good morning!
I'm going to post here the two codes I made as an example (the second is used here on the forum), in the first the background image is the way I need it, taking up 3/4 of the screen, but the second image is not transparent. In the second, the image occupies the entire screen and the image becomes transparent.
Att.,
Oliveiros Junior
/*-------------------------------------------------------------------------------
Sample 1
-------------------------------------------------------------------------------*/
#include "FiveWin.ch"
*-------------------------------------------------------------------------------*
Function Main()
Local oDlg, oImagem
Local cImagem := "..\bitmaps\pngs\2.png"
DEFINE DIALOG oDlg SIZE 800, 600 ;
STYLE nOr( WS_CHILD, WS_POPUP ) ;
COLOR CLR_BLACK, CLR_BLACK TRUEPIXEL
SetDlgGradient( { { 0.7, CLR_WHITE, CLR_WHITE }, ;
{ 0.3, CLR_BLACK, CLR_BLACK }, .F. } )
@ 0, 0 BITMAP oImagem FILENAME cImagem ;
SIZE 400, 600 OF ;
oDlg PIXEL NO BORDER ADJUST
ACTIVATE WINDOW oDlg CENTERED ;
ON INIT SobreporImagem( oDlg )
Return NIL
*------------------------------------------------------------------------------*
Function SobreporImagem( oDlg )
Local oImagem
Local cImagem := "..\bitmaps\pngs\home.png"
@ 0, 0 XIMAGE oImagem FILENAME cImagem ;
SIZE 200, 200 OF ;
oDlg NO BORDER
Return NIL
*------------------------------------------------------------------------------*
/*-------------------------------------------------------------------------------
Sample 2
-------------------------------------------------------------------------------*/
#include "FiveWin.ch"
*-------------------------------------------------------------------------------*
Function Main()
Local oDlg, oBitmap
Local cImagem := "..\bitmaps\pngs\home.png"
DEFINE DIALOG oDlg SIZE 800, 600 ;
STYLE nOr( WS_CHILD, WS_POPUP ) ;
COLOR CLR_BLACK, CLR_BLACK TRUEPIXEL
SetDlgGradient( { { 0.7, CLR_BLACK, CLR_BLACK }, ;
{ 0.3, CLR_WHITE, CLR_WHITE }, .F. } )
@ 0, 0 BITMAP oBitmap FILENAME cImagem ;
SIZE 200, 200 OF ;
oDlg NO BORDER
ACTIVATE WINDOW oDlg CENTERED ;
ON INIT SobreporImagem( oDlg )
Return NIL
*------------------------------------------------------------------------------*
Function SobreporImagem( oDlg )
Local oImagem, oBrush
Local cImagem := "..\bitmaps\pngs\2.png"
DEFINE IMAGE oImagem FILENAME cImagem
oBrush := TBrush():new( ,,,, ResizeBmp( oImagem:hBitmap, 600, 600, .T. ) )
oImagem:End()
oDlg:SetBrush( oBrush )
oBrush:End()
Return NIL
*----------------------------------------------------------------------------------*
Re: Brush
Posted:
Sun Apr 21, 2024 2:03 pm
by karinha
Vamos por partes, que nem JACK o Estripador:
- Code: Select all Expand view
// C:\FWH\SAMPLES\OLIVEJR3.PRG#include "FiveWin.ch"FUNCTION Main
() LOCAL oDlg, oImagem, oBrush
LOCAL cImagem :=
"..\bitmaps\pngs\2.png" DEFINE BRUSH oBrush FILE cImagem RESIZE
DEFINE DIALOG oDlg
SIZE 800,
600 STYLE nOr
( WS_CHILD, WS_POPUP
) ;
COLOR CLR_BLACK, CLR_BLACK
PIXEL TRUEPIXEL
BRUSH oBrush TRANSPARENT
ACTIVATE DIALOG oDlg
CENTERED ON INIT SobreporImagem
( oDlg
) oBrush:
End()RETURN NILFUNCTION SobreporImagem
( oDlg
) LOCAL oImagem
LOCAL cImagem :=
"..\bitmaps\pngs\home.png" @
0,
0 XIMAGE oImagem FILENAME cImagem
SIZE 200,
200 OF oDlg ;
NOBORDER
oImagem:
lTransparent := .T.
RETURN NIL// FIN / END - kapiabafwh@gmail.com
Regards, saludos.
Re: Brush
Posted:
Wed Apr 24, 2024 8:27 pm
by oliveiros junior
Olá,
Obrigado pelas possibilidades. Vou testar e retorno aqui.
Att.,
Oliveiros Junior