Small improvement on TCustomControl support for qt interface

git-svn-id: trunk@10517 -
This commit is contained in:
sekelsenmat 2007-01-27 12:13:13 +00:00
parent fbf6e4f232
commit 879c6ecde9
3 changed files with 32 additions and 1 deletions

View File

@ -299,7 +299,9 @@ end;
------------------------------------------------------------------------------}
constructor TQtImage.Create(Adata: PByte; width: Integer; height: Integer; format: QImageFormat);
begin
Handle := QImage_create(AData, width, height, format);
if Adata = nil then
Handle := QImage_create(width, height, format)
else Handle := QImage_create(AData, width, height, format);
{$ifdef VerboseQt}
WriteLn('TQtImage.Create Result:', PtrInt(Handle));

View File

@ -158,6 +158,34 @@ begin
end;
end;
{------------------------------------------------------------------------------
Method: TQtWidgetSet.CreateBitmap
Params:
Returns:
This functions is for TBitmap support.
Specifically it´s utilized on when a handle for a bitmap is needed
------------------------------------------------------------------------------}
function TQtWidgetSet.CreateBitmap(Width, Height: Integer;
Planes, BitCount: Longint; BitmapBits: Pointer): HBITMAP;
begin
{$ifdef VerboseQtWinAPI}
WriteLn('Trace:> [WinAPI CreateBitmap]',
' Width:', dbgs(Width),
' Height:', dbgs(Height),
' Planes:', dbgs(Planes),
' BitCount:', dbgs(BitCount),
' BitmapBits: ', dbgs(BitmapBits));
{$endif}
Result := HBitmap(TQtImage.Create(BitmapBits, Width,
Height, QImageFormat_RGB32));
{$ifdef VerboseQtWinAPI}
WriteLn('Trace:< [WinAPI CreateBitmap] Bitmap:', dbgs(Integer(Result)));
{$endif}
end;
{------------------------------------------------------------------------------
Method: TQtWidgetSet.CreateBitmapFromRawImage
Params:

View File

@ -30,6 +30,7 @@
function BeginPaint(Handle: hWnd; Var PS : TPaintStruct) : hdc; override;
Function CombineRgn(Dest, Src1, Src2: HRGN; fnCombineMode: Longint): Longint; override;
function CreateBitmap(Width, Height: Integer; Planes, BitCount: Longint; BitmapBits: Pointer): HBITMAP; override;
function CreateBitmapFromRawImage(const RawImage: TRawImage; var Bitmap, MaskBitmap: HBitmap; AlwaysCreateMask: boolean): boolean; override;
function CreateBrushIndirect(const LogBrush: TLogBrush): HBRUSH; override;
function CreateCompatibleDC(DC: HDC): HDC; override;