Link to home
Start Free TrialLog in
Avatar of kyriakos70
kyriakos70

asked on

Delphi unsuported format copyfromclipboard

Hello,
I have a dbimage component which has a picture, I call the copytoclipboard to copy to an imagezoom component but I get an error "unsupported file format"
code :
procedure TForm15.Button13Click(Sender: TObject);
var
Data: THandle;
Format: Word;
Palette: HPALETTE;
begin
if imagezoom1.Visible = false then
begin
edbimage1.CopyToClipboard;
Data := GetClipboardData(format);
Palette := GetClipboardData(CF_PALETTE);
imagezoom1.Visible := true;
imagezoom1.Picture.LoadFromClipboardFormat(format,data,palette);
Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kyriakos70
kyriakos70

ASKER

Hello,
I will try the registerclipboardformat, as for the data is a var Thandle for the loadfromclipboardformat(format:cf_bitmap,data: ClipBoard.GetAsHandle(cf_Bitmap),hpalette), but I don't know what to register in this format the bmp or the TJpeg?

wd123: I tried the has format but I get an "access violation error"

Kyriakos
Hello,
Thank you for your answers, I used the savetofile and loadfromfile functions and then deleted the temp file, for the RegisterClipboardFormat I always received a unsupported clipboard format.

Kyriakos