mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 19:49:16 +02:00
TQtImage.AsPixmap
git-svn-id: trunk@11460 -
This commit is contained in:
parent
af8e274993
commit
77dc0b4f95
@ -80,6 +80,7 @@ type
|
||||
constructor Create(Adata: PByte; width: Integer; height: Integer; format: QImageFormat); overload;
|
||||
destructor Destroy; override;
|
||||
function AsIcon(AMode: QIconMode = QIconNormal; AState: QIconState = QIconOff): QIconH;
|
||||
function AsPixmap: QPixmapH;
|
||||
public
|
||||
function height: Integer;
|
||||
function width: Integer;
|
||||
@ -460,14 +461,19 @@ function TQtImage.AsIcon(AMode: QIconMode = QIconNormal; AState: QIconState = QI
|
||||
var
|
||||
APixmap: QPixmapH;
|
||||
begin
|
||||
APixmap := QPixmap_create();
|
||||
QPixmap_fromImage(APixmap, Handle);
|
||||
APixmap := AsPixmap;
|
||||
Result := QIcon_create();
|
||||
if Result <> nil then
|
||||
QIcon_addPixmap(Result, APixmap, AMode, AState);
|
||||
QPixmap_destroy(APixmap);
|
||||
end;
|
||||
|
||||
function TQtImage.AsPixmap: QPixmapH;
|
||||
begin
|
||||
Result := QPixmap_create();
|
||||
QPixmap_fromImage(Result, Handle);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TQtImage.height
|
||||
Params: None
|
||||
|
Loading…
Reference in New Issue
Block a user