added exception handling for createpixmapindirect

git-svn-id: trunk@4008 -
This commit is contained in:
mattias 2003-04-03 17:42:13 +00:00
parent cb205b4d7b
commit ecd81f2cef
2 changed files with 17 additions and 5 deletions

View File

@ -39,7 +39,8 @@ end;
procedure TBitmap.Draw(ACanvas: TCanvas; const ARect: TRect);
begin
HandleNeeded;
ACanvas.CopyRect(ARect, Self.Canvas, Rect(0, 0, Width, Height));
if HandleAllocated then
ACanvas.CopyRect(ARect, Self.Canvas, Rect(0, 0, Width, Height));
end;
constructor TBitmap.VirtualCreate;
@ -188,7 +189,7 @@ var
pstr : PChar;
Begin
HandleNeeded;
if Filename<>'' then begin
if (Filename<>'') and HandleAllocated then begin
pStr:=PChar(Filename);
SendIntfMessage(LM_LOADXPM,Self,pstr);
end;
@ -416,7 +417,7 @@ begin
Reference;
FHandle:=Value;
FillChar(FDIB, sizeof(FDIB), 0);
if Value <> 0 then
if FHandle <> 0 then
GetObject(FHandle, SizeOf(FDIB), @FDIB);
Changed(Self);
end;
@ -528,6 +529,9 @@ end;
{ =============================================================================
$Log$
Revision 1.29 2003/04/03 17:42:13 mattias
added exception handling for createpixmapindirect
Revision 1.28 2003/03/12 14:39:29 mattias
fixed clipping origin in stretchblt

View File

@ -240,8 +240,13 @@ begin
FreeMem(XPM);
end;
FWidth:=NewWidth;
FHeight:=NewHeight;
if HandleAllocated then begin
FWidth:=NewWidth;
FHeight:=NewHeight;
end else begin
FWidth:=0;
FHeight:=0;
end;
end;
// included by graphics.pp
@ -249,6 +254,9 @@ end;
{ =============================================================================
$Log$
Revision 1.18 2003/04/03 17:42:13 mattias
added exception handling for createpixmapindirect
Revision 1.17 2002/12/18 17:59:12 mattias
minor cleanup