Thema: Delphi Help with Graphics32

Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Help with Graphics32

  Alt 19. Jan 2010, 13:24
Hello,

I'm new on GR32 and need some help with it.

So, currently I'm using TBitmap to process image and now I want to port projects to GR32 library, because it has nice componens to display, is very fast, have layers, nice objects to create transformation and generaly is very powerful.

These are my questions:

- How to add effect to layer? For example in background layer I have some color image. Now I want to remove colors from its part. When I decide this area without colors is in wrong place, I move layer to correct one and old area again is in colors and new without. But I don't understand how to do it... I know only how to do it with TBitmap/TBitmap32 (mean with "flat" image - see sample code below)...

- How to add antialiasing to custom generated image (generator similar to the one from texture blending demo)?

- How to save GR32 drawing to file and load from it (with layers! - something like Photoshop doing with their PSD files). I know how to export layered drawing to image (eg. BMP, PNG, etc.), but what about "project file"?

I'm asking this stupid questions, because I not found any solution or demo. GR32 is great, but support for it worst than bad... I hope you understand my not very well EN and could help?

PS: This is example filter for flat image:

Delphi-Quellcode:
procedure CreateGrey(ASource: TBitmap32);
var
  Row: PColorBGRA;
  I, J: Integer;
begin
  Row := PColorBGRA(@ASource.Bits[0]);

  for I := 0 to ASource.Height - 1 do
  begin
    for J := 0 to ASource.Width - 1 do
    begin
      Row.R := (Row.R + Row.G + Row.B) div 3;
      Row.G := Row.R;
      Row.B := Row.R;

      Inc(Row);
    end;
  end;

  ASource.Changed;
end;
  Mit Zitat antworten Zitat