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); procedure TBitmap.Draw(ACanvas: TCanvas; const ARect: TRect);
begin begin
HandleNeeded; 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; end;
constructor TBitmap.VirtualCreate; constructor TBitmap.VirtualCreate;
@ -188,7 +189,7 @@ var
pstr : PChar; pstr : PChar;
Begin Begin
HandleNeeded; HandleNeeded;
if Filename<>'' then begin if (Filename<>'') and HandleAllocated then begin
pStr:=PChar(Filename); pStr:=PChar(Filename);
SendIntfMessage(LM_LOADXPM,Self,pstr); SendIntfMessage(LM_LOADXPM,Self,pstr);
end; end;
@ -416,7 +417,7 @@ begin
Reference; Reference;
FHandle:=Value; FHandle:=Value;
FillChar(FDIB, sizeof(FDIB), 0); FillChar(FDIB, sizeof(FDIB), 0);
if Value <> 0 then if FHandle <> 0 then
GetObject(FHandle, SizeOf(FDIB), @FDIB); GetObject(FHandle, SizeOf(FDIB), @FDIB);
Changed(Self); Changed(Self);
end; end;
@ -528,6 +529,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $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 Revision 1.28 2003/03/12 14:39:29 mattias
fixed clipping origin in stretchblt fixed clipping origin in stretchblt

View File

@ -240,8 +240,13 @@ begin
FreeMem(XPM); FreeMem(XPM);
end; end;
FWidth:=NewWidth; if HandleAllocated then begin
FHeight:=NewHeight; FWidth:=NewWidth;
FHeight:=NewHeight;
end else begin
FWidth:=0;
FHeight:=0;
end;
end; end;
// included by graphics.pp // included by graphics.pp
@ -249,6 +254,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $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 Revision 1.17 2002/12/18 17:59:12 mattias
minor cleanup minor cleanup