 |
Club Builder Foro de C++Builder en español
|
| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
tyloya Master

Registrado: 20 Ago 2002Mensajes: 175
|
Publicado: Sab 30 Nov, 2002 2:06 pm Asunto: Refrescar aplicación |
|
|
Hola
Cuando pongo un fondo en el form de esta forma:
Image2->Picture->LoadFromFile("C:\\Mis documentos\\PROYECTO\\Imagenes\\texturas\\r11.bmp");
Image2->Visible=true;
Brush->Bitmap = Image2->Picture->Bitmap;
Hasta que no minimizo la aplicación y la vuelvo a maximizar no
se muestra la imagen al completo, y creo que es algo que tiene que ver
con el refresco, pero es que no sé dónde ni cómo hacerlo.
Si podéis indicarme cuál es la mejor solución os lo agradecería.
Un saludo |
|
| Volver arriba |
|
 |
Alfredo Invitado
|
Publicado: Mar 03 Dic, 2002 5:50 pm Asunto: Referescar |
|
|
Hay dos Procedimientos
Image1->Refresh();
Image1->Repaint();
Segun la ayuda debe repintar la imagen de inmediato. |
|
| Volver arriba |
|
 |
tyloya Master

Registrado: 20 Ago 2002Mensajes: 175
|
Publicado: Mar 03 Dic, 2002 6:27 pm Asunto: Re: Refrescar |
|
|
| Alfredo escribió: | Hay dos Procedimientos
Image1->Refresh();
Image1->Repaint();
Segun la ayuda debe repintar la imagen de inmediato. |
He probado con eso pero me sigue pasando lo mismo, para que aparezca por completo la imagen debo minimizar y maximizar el form MDI principal.
Dónde debería ponder esas llamadas? |
|
| Volver arriba |
|
 |
tecno Invitado
|
Publicado: Mar 03 Dic, 2002 8:09 pm Asunto: |
|
|
¡Hola!
Supongo que al poner "Brush->Bitmap = Image2->Picture->Bitmap" lo que pretendes es pasar la imagen al formulario. Si es así, el refresh has de hacerselo al formulario, no a la imagen: frmFormulario->Refresh().
Salu2.  |
|
| Volver arriba |
|
 |
tyloya Master

Registrado: 20 Ago 2002Mensajes: 175
|
Publicado: Mar 03 Dic, 2002 10:55 pm Asunto: |
|
|
Hola!!
Te explico lo que hago a ver si puedes ayudarme.
Esta es una llamada desde el form principal (un form MDI) al hacer click en una opción del menú. Cuando pulse la opción, aparecerán unos forms y un fondo, y al volver a pulsar desaparecerán.
void __fastcall TFormMDI::dctbClick(TObject *Sender)
{
FormMDI->WindowMenu=Ventana1;
DCT1->Checked =! DCT1->Checked;
if (jbtn->Down==true) jbtn->Down=false;
if (JPEG1->Checked)
{
JPEG1->Checked=false;
for(int N=0; N<MDIChildCount; N++){
MDIChildren[N]->Close();
}
}
if (frmdct!=NULL)
{
//frmdct=new Tfrmdct(FormMDI);
frmdct->Cerrarformsdct(this);
Panel1->Visible=false;
Image1->Visible=true;
Brush->Color=clGray;
frmdct=NULL;
}
else if (frmdct==NULL)
{
Image1->Refresh();
frmdct=new Tfrmdct(FormMDI);
FormMDI->Panel1->Visible=true;
isVisibleFormsDCT = true;
Panel1->Visible=true;
frmdct->Crearformsdct(frmdct);
// Asigna la imagen a modo de mosaico al Form
Image1->Picture->LoadFromFile("C:\\Mis documentos\\PROYECTO\\Imagenes\\texturas\\fondoverde.bmp");
Image1->Visible=true;
Brush->Bitmap = Image1->Picture->Bitmap;
frmdct->CargarMatrices(OrgImg);
}
//Aquí refresco form
FormMDI->Refresh();
delete frmdct;
}
Haciendo lo anterior la imagen de fondo no se ve completa, y no sé ya lo que puedo hacer.
Gracias por la ayuda |
|
| Volver arriba |
|
 |
DesaSoftware Invitado
|
Publicado: Mie 04 Dic, 2002 7:20 am Asunto: |
|
|
yo hago esto al abrica una nueva forma MDICHILD PRA QEU EL FONDO DEL mdi padre no se pierda
SetWindowLong(ClientHandle, GWL_WNDPROC, long(FOldClientProc));
frmUnidades= new TfrmUnidades(this);
SetWindowLong(ClientHandle, GWL_WNDPROC, long(FNewClientProc)); |
|
| Volver arriba |
|
 |
tyloya Master

Registrado: 20 Ago 2002Mensajes: 175
|
Publicado: Mie 04 Dic, 2002 10:47 am Asunto: |
|
|
Perdona, pero no llevo mucho tiempo con Builder C++ y no
encuentro lo que hace la función SetWindowLong.
Podrías aclararme lo que significa FOldClientProc (más bien a qué hace referencia), es que en la ayuda de Builder no encuentro la función anterior.
De todas formas creo que lo debería hacer sería un refresco de la aplicación, aunque ya he probado a refrescar el Image1 y a refrescar el
FormMDI(que es el principal)
Ta luego |
|
| Volver arriba |
|
 |
tecno Invitado
|
Publicado: Mie 04 Dic, 2002 12:03 pm Asunto: |
|
|
¡Hola!
SetWindowLong es una función de la API de Windows. Aquí tienes lo que viene en la ayuda de VB6:
SetWindowLong
The SetWindowLong function changes an attribute of the specified window. The function also sets a 32-bit (long) value at the specified offset into the extra window memory of a window.
LONG SetWindowLong(
HWND hWnd, // handle of window
int nIndex, // offset of value to set
LONG dwNewLong // new value
);
Parameters
hWnd
Handle to the window and, indirectly, the class to which the window belongs.
nIndex
Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus 4; for example, if you specified 12 or more bytes of extra memory, a value of 8 would be an index to the third 32-bit integer. To set any other value, specify one of the following values: Value Action
GWL_EXSTYLE Sets a new extended window style.
GWL_STYLE Sets a new window style.
GWL_WNDPROC Sets a new address for the window procedure.
GWL_HINSTANCE Sets a new application instance handle.
GWL_ID Sets a new identifier of the window.
GWL_USERDATA Sets the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.
The following values are also available when the hWnd parameter identifies a dialog box: Value Action
DWL_DLGPROC Sets the new address of the dialog box procedure.
DWL_MSGRESULT Sets the return value of a message processed in the dialog box procedure.
DWL_USER Sets new extra information that is private to the application, such as handles or pointers.
dwNewLong
Specifies the replacement value.
Return Values
If the function succeeds, the return value is the previous value of the specified 32-bit integer.
If the function fails, the return value is zero. To get extended error information, callGetLastError.
If the previous value of the specified 32-bit integer is zero, and the function succeeds, the return value is zero, but the function does not clear the last error information. This makes it difficult to determine success or failure. To deal with this, you should clear the last error information by callingSetLastError(0) before calling SetWindowLong. Then, function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.
Remarks
The SetWindowLong function fails if the window specified by the hWnd parameter does not belong to the same process as the calling thread.
Certain window data is cached, so changes you make using SetWindowLong will not take effect until you call the SetWindowPos function.
If you use SetWindowLong with the GWL_WNDPROC index to replace the window procedure, the window procedure must conform to the guidelines specified in the description of the WindowProc callback function.
If you use SetWindowLong with the DWL_MSGRESULT index to set the return value for a message processed by a dialog procedure, you should return TRUE directly afterwards. Otherwise, if you call any function that results in your dialog procedure receiving a window message, the nested window message could overwrite the return value you set using DWL_MSGRESULT.
Calling SetWindowLong with the GWL_WNDPROC index creates a subclass of the window class used to create the window. An application can subclass a system class, but should not subclass a window class created by another process. The SetWindowLong function creates the window subclass by changing the window procedure associated with a particular window class, causing the system to call the new window procedure instead of the previous one. An application must pass any messages not processed by the new window procedure to the previous window procedure by calling CallWindowProc. This allows the application to create a chain of window procedures.
Reserve extra window memory by specifying a nonzero value in the cbWndExtra member of the WNDCLASSEX structure used with the RegisterClassEx function.
You must not call SetWindowLong with the GWL_HWNDPARENT index to change the parent of a child window. Instead, use the SetParent function.
Windows CE: The nIndex parameter must be a multiple of 4 bytes.
Unaligned access is not supported.
The following nIndex parameter values are not supported:
GWL_HINSTANCE
GWL_HWNDPARENT
GWL_USERDATA
Windows CE versions 2.0 and later support the DWL_DLGPROC value in the nIndex parameter, but Windows CE 1.0 does not.
Siento no poder ayudarte mas. Salu2.  |
|
| Volver arriba |
|
 |
pampa Lt JG

Registrado: 16 Jun 2004Mensajes: 58Ubicación: Mar del Plata - Argentina
|
Publicado: Sab 15 Jul, 2006 1:58 am Asunto: |
|
|
¿lo han resuelto?
He buscado en el foro y no he podido encontrar la solución; resumiendo el problema: al cambiar la propiedad visible a true de, por ejemplo, un TImage no se visualiza o no se visualiza en su totalidad...asumo que hace falta forzar un refresco de pantalla o del control o...
Gracias. |
|
| Volver arriba |
|
 |
|
|
No puedes publicar temas nuevos en este foro No puedes responder a temas en este foro No puedes editar tus mensajes en este foro No puedes borrar tus mensajes en este foro No puedes votar en las encuestas de este foro
|
© 2002–2026 Club Builder · Funciona con phpBB.
|