reading image from clipboard slow lazarus / 39-Graphics ---------------------------------------------------------------------- BubikolRamios · 2013-01-19 16:00 I made as simple prog in vb6 which accepts clipboard image and shows it in my prog in image component. Rewrote it in Lazarus. While CTRL+V has instant effect in VB, only the code belov in lazarus takes 2-3 seconds. That is, it takes ~ 5 s from CTRL+V to point when image shows. Win 7 64 bit. The file copyed from clipbrdi is originaly 12 MB, nikon NEF. Any suggestion ? Code: [Select]    if Clipboard.HasFormat(PredefinedClipboardFormat(pcfDelphiBitmap)) then     bmp.LoadFromClipboardFormat(PredefinedClipboardFormat(pcfDelphiBit map))     else  if Clipboard.HasFormat(PredefinedClipboardFormat(pcfBitmap)) then     bmp.LoadFromClipboardFormat(PredefinedClipboardFormat(pcfBitmap)); ---------------------------------------------------------------------- User137 · 2013-01-19 23:03 Just something you can try... Make sure that -gv (valgrind) is disabled in Linking tab in Project options. If i recall, that made my 3D-models load ~100 times slower, from 0.1 second to 10 seconds. ---------------------------------------------------------------------- BubikolRamios · 2013-01-20 01:35 Thanks. That was default false, so it does not influence a thing. Any other idea ? ---------------------------------------------------------------------- BubikolRamios · 2013-01-20 02:32 Anyway, fishing in dark. should that work ?: Code: [Select]     if Clipboard.HasFormat(PredefinedClipboardFormat(pcfBitmap)) then     begin        bmp.Assign(Clipboard);     end;  it dies in last line here in TFPImageBitmap  with message: Wrong image format Code: [Select]procedure TFPImageBitmap.ReadStream(AStream: TMemoryStream; ASize: Longint); var   SCB: TSharedCustomBitmap;   IntfImg: TLazIntfImage;   ImgReader: TFPCustomImageReader;   LazReader: ILazImageReader; begin   IntfImg := nil;   ImgReader := nil;   try     // read image     ImgReader := GetReaderClass.Create;     ImgReader.OnProgress := Self.OnProgress;     IntfImg := TLazIntfImage.Create(0,0,[]);     InitializeReader(IntfImg, ImgReader);     if Supports(ImgReader, ILazImageReader, LazReader)     then LazReader.UpdateDescription := True     else IntfImg.DataDescription := GetDescriptionFromDevice(0, 0, 0); // fallback to default     ImgReader.ImageRead(AStream, IntfImg);     ...