Solved

Delphi unsuported format copyfromclipboard

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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.

724 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