Solved

Delphi unsuported format copyfromclipboard

Posted on 2008-10-17
4
1,177 Views
Last Modified: 2013-11-23
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?
0
Comment
Question by:kyriakos70
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 250 total points
ID: 22739511
What does this line mean
Data := GetClipboardData(format);
with unassigned format?

At what code line You've got error?

Maybe you should call RegisterClipboardFormat first?
0
 
LVL 5

Assisted Solution

by:wd123
wd123 earned 250 total points
ID: 22739768
try this:
 if ClipBoard.HasFormat(CF_BITMAP) then  Image1.Picture.Bitmap.LoadFromClipboardFormat(cf_BitMap, ClipBoard.GetAsHandle(cf_Bitmap), 0);
0
 

Author Comment

by:kyriakos70
ID: 22742193
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
0
 

Author Comment

by:kyriakos70
ID: 22751671
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
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question