Solved

Delphi unsuported format copyfromclipboard

Posted on 2008-10-17
4
1,156 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now