Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 16-05-2008
gallipi gallipi is offline
Miembro
 
Registrado: abr 2007
Posts: 29
Poder: 0
gallipi Va por buen camino
TImageList & cursor raton

Hola a todos,

Trabajo en una aplicación que tiene una barra de herramientas llena de iconos. Estos iconos estan almacenados en un Imagelist.

Cuando pulso un botón de la barra de herramientas quiero asignar el icono de éste, al cursor del ratón.


Código Delphi [-] bmp:TBitmap
bmp :=TBitmap.Create;
...
...
imagelist1.getBitmap(index,bmp);

SetCursorIcon(bmp);




Imaginaba q la funcion getBitmap, cargaría el icono en la variable BMP, pero lo cierto es q no es asi.
¿Como puedo sacar una imagen del imgaList?


Gracias!!!!
Responder Con Cita
  #2  
Antiguo 29-05-2008
Avatar de juanlaplata
juanlaplata juanlaplata is offline
Miembro
 
Registrado: ene 2007
Ubicación: La Plata, Bs. As. (Argentina)
Posts: 212
Poder: 18
juanlaplata Va por buen camino
Me intereso lo que planteas, y buscando me tope en la ayuda del propio delphi. Eso si, no es tan facil como elegir cual image de la ImageList, pero tampoco tan dificil, al menos eso parece.

Cita:
Lists the cursors available to the application.

property Cursors[Index: Integer]: HCursor;

Description

Use Cursor to access a particular cursor for use by the application or by a control within the application. TScreen includes several built-in cursors that are indexed by symbolic cursor constants. The image associated with the built-in cursors constants can be changed by setting the Cursors property.

Custom cursors can be added to the Cursors property for use by the application or any of its controls. To add a custom cursor to an application:

1 Create the cursor resource using a resource editor.
2 Declare a cursor constant with a value that does not conflict with an existing cursor constant.
3 Use the Windows API function LoadCursor to obtain a handle to the new cursor.
4 Set the Cursors property, indexed by the newly declared cursor constant, to the handle obtained from LoadCursor.

Note: Don’t call the Windows API function DestroyCursor when finished with a custom cursor; Delphidoes this automatically.
Cita:
This example shows how to add custom cursors to an application. It assumes that a custom cursor with the name NewCursor has been added to the resources (.RES file) of the application. You can add the cursor using the image editor. (Tools | Image Editor)
The following code makes this cursor available to the application via the constant crMyCursor, and sets it as the global cursor to the application.

const

crMyCursor = 5;
procedure TForm1.FormCreate(Sender: TObject);
begin
Screen.Cursors[crMyCursor] := LoadCursor(HInstance, 'NewCursor');
Cursor := crMyCursor;
end;
Suerte.
PD: como dije antes me intereso, y estoy probando de como hacerlo tambien. Cualquier avance estara por aqui. Saludos.
Responder Con Cita
  #3  
Antiguo 06-06-2008
Avatar de juanlaplata
juanlaplata juanlaplata is offline
Miembro
 
Registrado: ene 2007
Ubicación: La Plata, Bs. As. (Argentina)
Posts: 212
Poder: 18
juanlaplata Va por buen camino
Bueno, buceando un poco en el foro me tope con este hilo donde trataron el tema.
http://www.clubdelphi.com/foros/show...+al+ejecutable

Última edición por juanlaplata fecha: 06-06-2008 a las 15:11:57.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Duda con TImageList Perrero80 C++ Builder 3 06-08-2008 16:50:00
Problema con TImageList y Timage Archangel Gráficos 1 07-11-2007 23:53:32
Reducir una TImageList por encima Deiv Gráficos 7 10-11-2006 21:02:32
TImageList...como se usa? alt126 C++ Builder 2 09-02-2005 09:30:59
TImageList scooterjgm OOP 1 15-10-2004 10:43:55


La franja horaria es GMT +2. Ahora son las 10:02:07.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi