Changeset 268 for branches/highdpi/Packages/DpiControls/UDpiControls.pas
- Timestamp:
- Jun 26, 2020, 11:16:48 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r267 r268 565 565 public 566 566 NativeEdit: TEdit; 567 destructor Destroy; override; 567 568 property SelLength: Integer read GetSelLength write SetSelLength; 568 569 property SelStart: Integer read GetSelStart write SetSelStart; … … 1159 1160 end; 1160 1161 1162 destructor TDpiEdit.Destroy; 1163 begin 1164 FreeAndNil(NativeEdit); 1165 inherited; 1166 end; 1167 1161 1168 function TDpiEdit.GetSelLength: Integer; 1162 1169 begin … … 1400 1407 destructor TDpiMenuItem.Destroy; 1401 1408 begin 1402 FreeAndNil(NativeMenuItem);1403 1409 FreeAndNil(FItems); 1404 inherited Destroy; 1410 // TODO: Release menu items 1411 //FreeAndNil(NativeMenuItem); 1412 inherited; 1405 1413 end; 1406 1414 … … 1454 1462 begin 1455 1463 if Assigned(NativePopupMenu) then FreeAndNil(NativePopupMenu); 1456 inherited Destroy;1464 inherited; 1457 1465 end; 1458 1466 … … 1992 2000 begin 1993 2001 Bitmap := NativeGraphicClass.Create; 1994 Bitmap.LoadFromFile(FileName); 1995 Width := Bitmap.Width; 1996 Height := Bitmap.Height; 1997 if Self is TDpiBitmap then begin 1998 StretchDrawBitmap(TRasterImage(Bitmap), TBitmap(GetNativeGraphic)); 1999 //TBitmap(GetNativeGraphic).Canvas.StretchDraw(Bounds(0, 0, 2000 //TBitmap(GetNativeGraphic).Width, TBitmap(GetNativeGraphic).Height), Bitmap); 2001 end else raise Exception.Create('Unsupported class ' + Self.ClassName); 2002 FreeAndNil(Bitmap); 2002 try 2003 Bitmap.LoadFromFile(FileName); 2004 Width := Bitmap.Width; 2005 Height := Bitmap.Height; 2006 if Self is TDpiBitmap then begin 2007 StretchDrawBitmap(TRasterImage(Bitmap), TBitmap(GetNativeGraphic)); 2008 //TBitmap(GetNativeGraphic).Canvas.StretchDraw(Bounds(0, 0, 2009 //TBitmap(GetNativeGraphic).Width, TBitmap(GetNativeGraphic).Height), Bitmap); 2010 end else raise Exception.Create('Unsupported class ' + Self.ClassName); 2011 finally 2012 FreeAndNil(Bitmap); 2013 end; 2003 2014 end; 2004 2015 … … 2008 2019 begin 2009 2020 Bitmap := NativeGraphicClass.Create; 2010 Bitmap.Width := Width; 2011 Bitmap.Height := Height; 2012 if Self is TDpiBitmap then begin 2013 if Bitmap is TRasterImage then 2014 (Bitmap as TRasterImage).Canvas.StretchDraw(Bounds(0, 0, Bitmap.Width, Bitmap.Height), TBitmap(GetNativeGraphic)) 2015 else raise Exception.Create('Expected TRasterImage but got ' + Bitmap.ClassName); 2016 end else raise Exception.Create('Unsupported class ' + Self.ClassName); 2017 Bitmap.SaveToFile(FileName); 2018 FreeAndNil(Bitmap); 2021 try 2022 Bitmap.Width := Width; 2023 Bitmap.Height := Height; 2024 if Self is TDpiBitmap then begin 2025 if Bitmap is TRasterImage then 2026 (Bitmap as TRasterImage).Canvas.StretchDraw(Bounds(0, 0, Bitmap.Width, Bitmap.Height), TBitmap(GetNativeGraphic)) 2027 else raise Exception.Create('Expected TRasterImage but got ' + Bitmap.ClassName); 2028 end else raise Exception.Create('Unsupported class ' + Self.ClassName); 2029 Bitmap.SaveToFile(FileName); 2030 finally 2031 FreeAndNil(Bitmap); 2032 end; 2019 2033 end; 2020 2034
Note:
See TracChangeset
for help on using the changeset viewer.