Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > OOP
Register FAQ Members List Calendar Guía de estilo Today's Posts

Coloboración Paypal con ClubDelphi

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 21/06/2013
Olenkaguilar Olenkaguilar is offline
Miembro
NULL
 
Join Date: May 2013
Posts: 20
Poder: 0
Olenkaguilar Va por buen camino
Wink Una ayuda con Imágenes PNG

Bueno resulta que quiero poner imágenes PNG a los Buttons y utilizar la propiedad FLAT( que al pasar el puntero aparezca el button), lo hice de la siguiente manera:

Código Delphi [-]
unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, PngImage, Vcl.Buttons;

type
  TForm2 = class(TForm)
    SpeedButton1: TSpeedButton;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}
{$R Misrecursos.res}
procedure LoadPNGFromResource(Picture: TPicture; const ResName: string); overload;
var
  Png: TPngImage;
begin
  Png := TPngImage.Create;
  try
    Png.LoadFromResourceName(HInstance, ResName);
    Picture.Assign(Png);
  finally
    if Assigned(Png) then  FreeAndNil(Png);
  end;
end;

procedure LoadPNGFromResource(Bitmap: TBitmap; const ResName: string); overload;
var
  Png: TPngImage;
begin
  Png := TPngImage.Create;
  try
    Png.LoadFromResourceName(HInstance, ResName);
    Bitmap.Assign(Png);
  finally
    if Assigned(Png) then  FreeAndNil(Png);
  end;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
LoadPNGFromResource(SpeedButton1.Glyph, 'RES_IMG_BROOM_16X');
end;

end

Me funciono pero lo malo es que la imagen PNG se nota muy fea. Lo que supongo que le faltaría las opciones de:
- DrawingStyle: dsTransparent
- ColorDepth: cd32Bit
Esas propiedades funcionan en un TimageList, pero no sé a lo mejor le falta eso a mi codigo.
Utilizaría un TimageList y otro Button, me olvidaría de los recursos, si no cargaría directamente los PNG al ImageList y Listo, pero al parecer otros Button no tienen la propiedad FLAT.
Bueno espero su ayuda ya que recién estoy empezando y soy un poco novata.
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ayuda!!!trabajo con imagenes PNG lisette C++ Builder 5 26/04/2012 08:22
ayuda , que las imagenes no se superpongan ?? Mindfield API de Windows 11 01/04/2009 17:36
Ayuda con insercion de imágenes en campo blob aojeda Gráficos 0 29/01/2009 18:23
Ayuda con imagenes Jraul_Montu Internet 1 24/06/2007 02:17
Ayuda en php con imagenes. gatsu PHP 5 28/01/2004 09:54


All times are GMT +2. The time now is 21:10.


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