Drag and drop d'une image au format .webp D6 et Windows 10 64bits
Bonsoir à toutes et à tous,
Avec un TopenDialog pas de problème je charge une image au format webp et l'affiche dans un Tpicture avec freeimage.dll.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
mplementation
uses FreeBitmap, FreeUtils;
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
var
aFreeBitmap: TFreeWinBitmap;
aBmp: TBitmap;
aCol: TRGBQuad;
begin
OpenDialog1.Filter := FIU_GetFullExtList;
if OpenDialog1.Execute then
begin
aFreeBitmap := TFreeWinBitmap.Create;
try
if aFreeBitmap.Load(OpenDialog1.FileName) then
begin
aBmp := TBitmap.Create;
try
aBmp.Width := aFreeBitmap.GetWidth;
aBmp.Height := aFreeBitmap.GetHeight;
// Couleur de fond pour image transparente
Integer(aCol) := ByteSwap(clWhite);
aFreeBitmap.DrawEx(aBmp.Canvas.Handle, Rect(0, 0, aBmp.Width, aBmp.Height), False, @aCol);
Image1.Picture.Bitmap.Assign(aBmp);
finally
aBmp.Free;
end;
end;
finally
aFreeBitmap.Free;
end;
end;
end; |
J'essaye en vain (plusieurs codes !) de pouvoir utiliser la méthode du drag and drop en plus du TopenDialog mais problème.
Si quelqu'un à une idée cela me ferait plaisir.
Citation:
Je rectifie ce jour, le drag and drop fonctionne depuis l'Exploreur et du dossier vers l'application mais pas depuis la page Web !
@+,
cincap