FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
||||
|
||||
Imagen de fondo en formulario
Hola amigos, tengo un form al que le quiero poner una imagen como fondo pero el problema es que en dicho form tengo TPanels y objetos similares y al ejecutar los objetos de ese tipo no son transparentes y tapan la imagen de fondo del form. ¿Que debo hacer para que esos elementos sean transparentes?
|
#2
|
||||
|
||||
He encontrado esto en Delphi: https://stackoverflow.com/questions/...el-transparent
Pero no entiendo nada. Y esto en builder: http://www.delphigroups.info/3/2/174853.html Pero tampoco soy capaz de entender lo que hace aunque creo que lo que hace es crear un nuevo componente TPanel y crearle la propiedad de transparencia pero no sé bien que hace y me gustaría que alguien pudiera ayudarme a hacerlo funcionar porque la cuestión no es copiar y pegar código sino entenderlo. ¿Podéis ayudarme? |
#3
|
||||
|
||||
Los componentes de la VCL no están pensados inicialmente para soportar transparencias, así que todo lo que hagas en ese sentido deberá ser "manual" y seguramente no muy eficiente.
¿Tienes posibilidad de usar en este caso FireMonkey? Te facilitaría mucho las cosas.
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. |
#4
|
||||
|
||||
La verdad es que no sé ni qué es eso. ¿No hay componentes de terceros que ofrezcan esa opción? He estado mirando los de alpha skins y alguno más pero no veo cómo hacerlo transparente.
|
#5
|
||||
|
||||
Hola.
Derivando de un TPanel te hice un ejemplo básico como para que puedas ir trabajando sobre él: Código PHP:
Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... Última edición por ecfisa fecha: 05-12-2017 a las 21:03:10. |
#6
|
||||
|
||||
La verdad es que no sabría hacer para crear lo que haces y me harías un gran favor si me describirse los pasos para hacerlo y me comentase que va haciendo el código. Nunca he creado un componente y estoy muy perdido para hacer lo que haces.
|
#7
|
||||
|
||||
Hola.
El ejemplo no es difícil de implementar, sólo debes copiar el código de la declaración de la clase derivada en la unidad que vayas a usarlo. Basándote en ese código, luego no te será muy difícil crear tu componente panel transparente; de echo vas a encontrar en la web varios tutoriales muy didácticos sobre creación de componentes en C++ Builder. Te adjunto el código fuente del ejemplo para que puedas probarlo y revisarlo. ( C++ Builder 6 ) Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#8
|
||||
|
||||
He estado probando tu codigo y me encuentro con una serie de problemas a extrapolarlo a otros componentes que necesito tambien hacerlos transparentes y que irán dentro de dicho TPanelClear. Son TGroupBox, TRadioGroup, y TCheckBox. Ademas de que no consigo hacer a ninguno de ellos transparentes con tu codigo, el TCheckBox no me deja ni compilar porque dice que Canvas no se reconoce. Te pego el codigo:
Código PHP:
Una vez consiguiese hacer que todo funcione correctamente la idea ya seria crear componentes con dichos codigos a ver si soy capaz |
#9
|
||||
|
||||
Asi lo tengo ahora mismo:
El .h del Form: Código PHP:
Código PHP:
Código PHP:
Código PHP:
Código PHP:
Código PHP:
Código PHP:
Código PHP:
Código PHP:
Código PHP:
|
#10
|
||||
|
||||
Cita:
Con respecto a los componentes, el código sólo era para derivados de TPanel; lamentablemente no funcionará para todos los controles. Hacer un conjunto grande de componentes que tengan la propiedad de ser transparentes es una tarea bastante árdua. Si es tu intención (o necesidad) usar esa propiedad sobre un grupo grande de controles, lo mas simple sería buscar alguna biblioteca de terceros que ya lo implemente. Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... Última edición por ecfisa fecha: 06-12-2017 a las 18:35:44. |
#11
|
||||
|
||||
¿Conoces algún pack de tercero que tenga esa opción?
|
#12
|
||||
|
||||
Hola.
No, lamento no conocer ninguno, pero encontré un artículo que tal vez te resulte interesante: An easy way to create transparent button En tanto que para los controles TGroupBox y TRadioGroup, podes usar: Código PHP:
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#13
|
||||
|
||||
La verdad es que solo necesito que tengan transparencia los checkboxs, radiogroups, groupboxs, labels, y paneles. Los paneles ya están listos, según me indicas, con ese código ya tendría listo los radiogroups y groupboxs y me quedaría solo los checkbox y labels y no recuerdo si el label ya trae esa propiedad.
|
#14
|
||||
|
||||
Hola.
Con el TLabel no tendrías problemas ya que posee la propiedad Transparent. Y ya que estamos, código para el CheckBox, CheckBoxClear.h: Código PHP:
Código PHP:
Código PHP:
Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#15
|
||||
|
||||
Gracias amigo, los código del radiogroup y del listbox no me surten ningún efecto.
He estado probando los componentes de TMS que entre todo lo que trae vienen esos componentes con transparencia pero van de pena y tan lento que se puede ver cómo aplica la transparencia. Lo que tú estás haciendo es infinitamente más eficiente. Si pudieras revisar esos dos componentes te estaría muy agradecido. Ya luego me tocaría empollar y ver cómo pasarlos a componentes. Encontré este código para un radiogroup por si es de utilidad: Código PHP:
Última edición por aguml fecha: 08-12-2017 a las 02:10:16. |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Fondo en formulario que no se ve | Ramsay | Varios | 1 | 06-02-2016 02:23:35 |
Otra forma de cambiar color fondo formulario | chino150 | Varios | 2 | 16-02-2011 09:46:58 |
Mantener el Formulario principal en el fondo. | Critter | Lazarus, FreePascal, Kylix, etc. | 5 | 25-10-2010 10:04:27 |
Poner un control en el fondo de un formulario MDI | Egroc | Varios | 6 | 31-03-2007 02:56:57 |
Imagen de Fondo | lucasarts_18 | Gráficos | 7 | 16-06-2005 17:03:04 |
|