Autor Beitrag
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Do 29.05.03 09:46 
Hallo ich habe folgenden Code:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
procedure Blend(FromBit, ToBit, NewBit: TBitmap);
var
  pt, pf, pn: PByteArray;
  h, w: Integer;
begin
  for h:=0 to ToBit.Height-1 do
   begin
    pt:= ToBit.ScanLine[h];
    pf:= FromBit.ScanLine[h];
    pn:= NewBit.ScanLine[h];
    for w:=0 to (ToBit.Width *3)-1 do
     pn^[w]:= round(pf^[w] - ((pf^[w]-pt^[w]) / 100 * ws));
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
 bg,window,kl : TBitmap;
begin
 bg := TBitmap.Create;
 window := TBitmap.Create;
 kl := TBitmap.Create;
 bg.LoadFromfile('F:\My Delphi\bali\pics\hintergrund_strand.bmp');
 window.LoadFromfile('F:\My Delphi\bali\pics\windows\taskbar_top.bmp');
 window.transparentcolor := clwhite;
 window.transparent := true;
 Image1.picture.LoadFromfile('F:\My Delphi\bali\pics\hintergrund_strand.bmp');
 Image2.canvas.CopyRect(Rect(0,0,400,400),Image1.Canvas,Rect(0,0,400,400));
 Image2.picture.SaveToFile('c:\bali.bmp');
 kl.loadfromfile('C:\bali.bmp');
 image2.picture.Assign(kl);
// Image2.picture.bitmap := kl;
 Blend(Image2.Picture.Bitmap,window,Image1.picture.Bitmap);
end;


Compilieren lässt sich der Code auch (auch wenn er umständlich ist ;-)) aber auf den Button klick stürtzt der immer an der Stelle in der Blendprozedur ab...

ausblenden Delphi-Quelltext
1:
2:
    for w:=0 to (ToBit.Width *3)-1 do
     pn^[w]:= round(pf^[w] - ((pf^[w]-pt^[w]) / 100 * ws));


Ich hab nur kein Plan warum??

thÄnxX

fcg

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Do 29.05.03 18:40 
Sind alle Bitmaps 24Bit? Siehe Eignenschaft "TBitmap.PixelFormat".

_________________
Life is a bad adventure, but the graphic is really good!
fcg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Fr 30.05.03 08:59 
Alle Bitmaps sind 24Bit...

geht trotzdem nit :-(

Und noch nen Problem: Wenn ich Transparent auf True setzte, bringt das beim Überblenden nichts...

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.