Ignore:
Timestamp:
Nov 25, 2021, 11:32:55 AM (3 years ago)
Author:
chronos
Message:
  • Added: Bottom column filter bar in contacts list.
  • Added: Allow to sort columns in contacts list.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.pas

    r31 r32  
    182182      Photo := PhotoProperty.GetDecodedValue;
    183183      Stream := TMemoryStream.Create;
    184       Stream.Write(Photo[1], Length(Photo));
    185       Stream.Position := 0;
    186       JpegImage := TJPEGImage.Create;
    187       JpegImage.LoadFromStream(Stream);
    188       ImagePhoto.Picture.Bitmap.SetSize(JpegImage.Width, JpegImage.Height);
    189       ImagePhoto.Picture.Bitmap.Canvas.Draw(0, 0, JpegImage);
    190       JpegImage.Free;
    191       Stream.Free;
     184      try
     185        Stream.Write(Photo[1], Length(Photo));
     186        Stream.Position := 0;
     187        if PhotoProperty.Attributes.IndexOf('JPEG') <> -1 then begin
     188          JpegImage := TJPEGImage.Create;
     189          try
     190            JpegImage.LoadFromStream(Stream);
     191            ImagePhoto.Picture.Bitmap.SetSize(JpegImage.Width, JpegImage.Height);
     192            ImagePhoto.Picture.Bitmap.Canvas.Draw(0, 0, JpegImage);
     193          finally
     194            JpegImage.Free;
     195          end;
     196        end else begin
     197          ImagePhoto.Picture.Bitmap.LoadFromStream(Stream);
     198        end;
     199      finally
     200        Stream.Free;
     201      end;
    192202    end;
    193203  end;
Note: See TracChangeset for help on using the changeset viewer.