Mattias Gaertner schreef:
On Fri, 10 Aug 2007 11:18:59 +0400
skywriter <[EMAIL PROTECTED]> wrote:

LCL file clipbrd.inc contains the following method which is unable to get picture from clipboard (Lazarus 0.9.22, Win32 platfotm):

function TClipboard.AssignToGraphic(Dest: TGraphic; FormatID: TClipboardFormat
  ): boolean;
var
  MemStream: TMemoryStream;
begin
  Result:=false;
  if FormatID=0 then exit;
  MemStream:=TMemoryStream.Create;
  try
    // if not GetFormat(FormatID,MemStream) then exit;

In current lazarus svn the above line is not commented.
Can you test if the bug still exists in the developer version?
Instead of CF_BITMAP use PredefinedClipboardFormat[pcfBitmap].


    MemStream.Position:=0;
    Dest.LoadFromMimeStream(MemStream,ClipboardFormatToMimeType(FormatID));
  finally
    MemStream.Free;
  end;
  Result:=true;
end;

I think MemStream object should be filled by some data, isn't it? But
i don't know how to.

And also TClipboard.HasFormat( CF_Bitmap) returns false. But at the
same time i sure the clipboard contains bitmap,
and it is possible to paste this bitmap into MS Paint or extract in Delphi with "Destination.LoadFromClipboardFormat(CF_Bitmap, ClipBoard.GetAsHandle(CF_Bitmap), 0)" method.

I guess, the win32 interface function
TWin32WidgetSet.ClipboardRegisterFormatcan should be extended:

Instead of
  else if AMimeType=PredefinedClipboardMimeTypes[pcfBitmap] then
it should be:
  else if (AMimeType=PredefinedClipboardMimeTypes[pcfBitmap])
       or (AMimeType=PredefinedClipboardMimeTypes[pcfDelphiBitmap]) then

Can a win32 user test this?

SkyWriter, can you give me a test application?

Vincent

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to