?
Solved

Delphi unsuported format copyfromclipboard

Posted on 2008-10-17
4
Medium Priority
?
1,215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 750 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 750 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

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