Board index » delphi » metafile aus dem Clipboard

metafile aus dem Clipboard

Hi,

does anybody get a metafile from the clipboard ever? The Delphi Buglist
says:

Description  
Reported by Anders Melander
Help for TMetafile.LoadFromClipboardFormat claims that
"LoadFromClipboardFormat replaces the current image with the data pointed
to by the AData parameter" and "The palette for the metafile is specified
by the APalette parameter". This is not correct; Both the AData and
APalette parameters are ignored. Instead the data is retrieved directly
from the clipboard.
IMO TMetafile.LoadFromClipboardFormat is poorly implemented; It should
only access the clipboard directly if the AData parameter is zero, it
should make use of the AFormat parameter and it should handle both
CF_ENHMETAFILE and CF_METAFILEPICT without using the clipboard to do the
conversion (unless AData is zero).

My Code:

meta:=TMetafile.Create;
Meta.LoadFromClipboardFormat (CF_METAFILEPICT,0,0);

// Or: Meta.LoadFromClipboardFormat
(CF_METAFILEPICT,Clipboard.GetAsHandle (CF_METAFILEPICT),0);

meta.SaveToFile ('test.wmf')
meta.Free;

In both versions there is only an exception.

Can you help me?

Mit freundlichen Gr?en / with best regards

Christian Hartnick
Dipl.-Wirtsch.-Inf, Senior IT-Manager
Zeilbeck Design Company, Leuchtenbergring 20, 81677 Mnchen, Germany
hartn...@zeilbeck.de, Tel.: 089 547065 33, Fax: 089 547065 30
http://www.zeilbeck.de

 

Re:metafile aus dem Clipboard


You must include the Unit Clipbrd, then you can use these formats:

      Konstante

      Formatwert

                CF_TEXT
     1

                CF_BITMAP
     2

                CF_METAFILEPICT
     3

                CF_SYLK
     4

                CF_DIF
     5

                CF_TIFF
     6

                CF_OEMTEXT
     7

                CF_DIB
     8

                CF_PALETTE
     9

                CF_PENDATA
     10

                CF_RIFF
     11

                CF_WAVE
     12

                CF_UNICODETEXT
     13

                CF_ENHMETAFILE
     14

                CF_HDROP
     15

Re:metafile aus dem Clipboard


Sorry, for that bad mail, it's Outlook Express

Ok, a new try:

uses
    ..., clipbrd;

{...}

Then you can use these Typs:

1 CF_TEXT
2 CF_BITMAP
3 CF_METAFILEPIC
4 CF_SYLK
5 CF_DIF
6 CF_TIFF
7 CF_OEMTEXT
8 CF_DIB
9 CF_PALETTE
10 CF_PENDATA
11 CF_RIFF
12 CF_WAVE
13 CF_UNICODETEXT
14 CF_ENHMETAFILE
15 CF_DHROP

(
CF_COMPONENT
CF_PICTURE
)

Re:metafile aus dem Clipboard


Thanx, but I do have done this.

Christian

Quote
>>>>>>>>>>>>>>>>>> Ursprngliche Nachricht <<<<<<<<<<<<<<<<<<

Am 15.12.2000, 13:46:29, schrieb "Heinz Becker" <KaasbomberS...@gmx.de> zum
Thema Re: metafile aus dem Clipboard:
Quote
> You must include the Unit Clipbrd, then you can use these formats:
>       Konstante
>       Formatwert
>                 CF_TEXT
>      1
>                 CF_BITMAP
>      2
>                 CF_METAFILEPICT
>      3
>                 CF_SYLK
>      4
>                 CF_DIF
>      5
>                 CF_TIFF
>      6
>                 CF_OEMTEXT
>      7
>                 CF_DIB
>      8
>                 CF_PALETTE
>      9
>                 CF_PENDATA
>      10
>                 CF_RIFF
>      11
>                 CF_WAVE
>      12
>                 CF_UNICODETEXT
>      13
>                 CF_ENHMETAFILE
>      14
>                 CF_HDROP
>      15

Other Threads