Changeset 54 for trunk/Forms/UFormContact.pas
- Timestamp:
- Dec 8, 2021, 2:29:29 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.pas
r50 r54 206 206 Stream: TMemoryStream; 207 207 JpegImage: TJpegImage; 208 PngImage: TPortableNetworkGraphic; 208 209 begin 209 210 Contact.Fields[cfFullName] := EditFullName.Text; … … 247 248 JpegImage.Free; 248 249 end; 250 end else 251 if PhotoProperty.Attributes.IndexOf('PNG') <> -1 then begin 252 PngImage := TPortableNetworkGraphic.Create; 253 try 254 try 255 PngImage.SetSize(ImagePhoto.Picture.Bitmap.Width, ImagePhoto.Picture.Bitmap.Height); 256 PngImage.Canvas.Draw(0, 0, ImagePhoto.Picture.Bitmap); 257 PngImage.SaveToStream(Stream); 258 except 259 end; 260 finally 261 PngImage.Free; 262 end; 249 263 end else begin 250 264 try … … 274 288 Photo: string; 275 289 JpegImage: TJpegImage; 290 PngImage: TPortableNetworkGraphic; 276 291 Stream: TMemoryStream; 277 292 PhotoProperty: TContactProperty; … … 319 334 JpegImage.Free; 320 335 end; 336 end else 337 if PhotoProperty.Attributes.IndexOf('PNG') <> -1 then begin 338 PngImage := TPortableNetworkGraphic.Create; 339 try 340 try 341 PngImage.LoadFromStream(Stream); 342 with ImagePhoto.Picture.Bitmap do begin 343 PixelFormat := pf24bit; 344 SetSize(PngImage.Width, PngImage.Height); 345 Canvas.Draw(0, 0, PngImage); 346 end; 347 ProfilePhotoActive := True; 348 except 349 ProfilePhotoActive := False; 350 end; 351 finally 352 PngImage.Free; 353 end; 321 354 end else begin 322 355 try
Note:
See TracChangeset
for help on using the changeset viewer.