Changeset 15 for trunk/UGraphic.pas
- Timestamp:
- Sep 22, 2014, 11:06:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGraphic.pas
r14 r15 51 51 procedure Assign(Source: TGColor); virtual; 52 52 constructor Create; 53 destructor Destroy; override; 53 54 property Channels[Channel: TGColorChannel]: TGColor read GetChannel; 54 55 property Data: TBitMemory read FData; … … 339 340 if FColorFormat = AValue then Exit; 340 341 FColorFormat := AValue; 341 FData.Size := FColorFormat.BitDepth; 342 if Assigned(FColorFormat) then 343 FData.Size := FColorFormat.BitDepth 344 else FData.Size := 0; 342 345 end; 343 346 … … 406 409 begin 407 410 FData := TBitMemory.Create; 408 Format := TGColorFormat.Create; 411 Format := nil; 412 end; 413 414 destructor TGColor.Destroy; 415 begin 416 FData.Free; 417 inherited Destroy; 409 418 end; 410 419 … … 566 575 X, Y: Integer; 567 576 Color: TGColor; 577 Color2: TGColor; 568 578 begin 569 579 for Y := 0 to Size.Y div 2 - 1 do 570 580 for X := 0 to Size.X - 1 do begin 571 581 Color := Pixels[X, Y]; 572 Pixels[X, Y] := Pixels[X, Size.Y - 1 - Y]; 582 Color2 := Pixels[X, Size.Y - 1 - Y]; 583 Pixels[X, Y] := Color2; 584 Color2.Free; 573 585 Pixels[X, Size.Y - 1 - Y] := Color; 574 586 Color.Free; … … 580 592 X, Y: Integer; 581 593 Color: TGColor; 594 Color2: TGColor; 582 595 begin 583 596 for Y := 0 to Size.Y - 1 do 584 597 for X := 0 to Size.X div 2 - 1 do begin 585 598 Color := Pixels[X, Y]; 586 Pixels[X, Y] := Pixels[Size.X - 1 - X, Y]; 599 Color2 := Pixels[Size.X - 1 - X, Y]; 600 Pixels[X, Y] := Color2; 601 Color2.Free; 587 602 Pixels[Size.X - 1 - X, Y] := Color; 588 603 Color.Free; … … 608 623 FData := TBitMemory.Create; 609 624 FBackgroundColor := TGColor.Create; 610 ColorFormat := TGColorFormat.Create; 611 FBackgroundColor.Format := ColorFormat; 612 FBackgroundColor.FromTColor(clBlack); 625 ColorFormat := nil; 613 626 Canvas := TGCanvas.Create; 614 627 Canvas.Bitmap := Self; … … 617 630 destructor TGBitmap.Destroy; 618 631 begin 632 FBackgroundColor.Free; 633 Canvas.Free; 619 634 Size := Point(0, 0); 620 635 FData.Free;
Note:
See TracChangeset
for help on using the changeset viewer.