Autor Beitrag
aliB
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 29

ccux Linux, Windows XP SP2

BeitragVerfasst: Mo 13.03.06 14:04 
Hab ne Weile mit einigen Lösungen herum gespielt aber es sieht alles nicht so toll aus.
Mit einer einzigen Farbe wirkt der Schatten immer künstlich.
Ich hätte sehr gerne so einen Schatten wie ihn CorelDraw auch zeichnet, weiß aber absolut nicht wie man das anstellen soll?
Hoffe jemand kann hier helfen.
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Di 14.03.06 08:33 
Magst du mal ein Bild posten? Ich habe kein Corel.

Was willst du denn als Ausgangsbasis benutzen, ein TIcon(somit weißt du den Umriss) oder ein normales Bild(wo man den Umriß erst bestimmen müsste)?
aliB Threadstarter
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 29

ccux Linux, Windows XP SP2

BeitragVerfasst: Di 14.03.06 09:20 
Es muss nicht genau so aussehen, es muss nur echt wirken.
Wie gesagt nur eine Farbe als Schatten wirkt unecht.
Der Schatten auf dem Bild überzeugt mehr durch die weichen Kannten & Übergänge.
Einloggen, um Attachments anzusehen!
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Di 14.03.06 09:26 
Nur mal aus Interesse: wo siehst du im angehängten Screenshot Schatten :gruebel: ?

AXMD
aliB Threadstarter
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 29

ccux Linux, Windows XP SP2

BeitragVerfasst: Di 14.03.06 09:32 
An der rechten und unteren Seite des Fensters ist ein ca. 10 Pixel breiter Streifen den ich eigentlich als Schatten identifizieren würde. ;)
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 14.03.06 19:57 
Eventuell hilft mein Vorschlag hier:
www.delphi-forum.de/viewtopic.php?t=56974

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
aliB Threadstarter
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 29

ccux Linux, Windows XP SP2

BeitragVerfasst: Di 14.03.06 22:19 
Ne, ist nicht wirklich etwas was mir weiterhilft.
Ich hab die Bitmaps schon fertig auf meinem Rechner liegen. (ca. 160 Stück)
Ich will daraus eine Doku machen und damit die Bilder schöner aussehen einen Schatten hinzufügen. Ich hab keine Lust bei soviel Bildern das ganze händisch zu machen.
Das Hinzufügen eines "einfachen" Schattens klappt ja, ich dachte nur, vieleicht kennt hier einer einen Algorithmuss der schönere Schatten generiert.
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Di 14.03.06 23:27 
Was wäre hiermit?
Du bastelst dir einfach den Schatten schon vorher mit z.B. Corel in einzelnen Stücken für rechts, unten und die Ecken
und dann fügst du das ganze zusammen. So, wie ichs mir vorstelle könnte es klappen, habs aber noch nie ausprobiert.
Bei Problemen einfach fragen, dann beschäftige ich mich nochma eingehender mit dem Thema :mrgreen:
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 15.03.06 08:41 
Deine Benutzer wollen doch schnell das finden, was sie in der Doku suchen und nicht die schönen Schatten bewundern :P
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Mi 15.03.06 09:44 
Hallo,

Ich wuerde eine Bitmap B in erstellen die um z.B 10 Bildpunkte breiter und hoeher ist und unten rechts und an der rechten Seite jeweils ein Rechteck R in Schattenfarbe(<> clBlack) zeichnen.
Dann unten einen gefuellten Kreis mit den umhuellenden Koordinaten
B.Weite-20,B.Hoehe-20,B.Weite,B.Hoehe
Jetzt das OriginalBild hineinkopieren und clBlack als Transparentfarbe auswaehlen.
BBBR
BBBR
RRRK

Gruss Horst
aliB Threadstarter
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 29

ccux Linux, Windows XP SP2

BeitragVerfasst: Do 16.03.06 17:16 
:shock:
Sorry, hab leider nichts verstanden. :oops:
Du willst also das Bitmap B als Hintergrund für das Original Bild nehmen. (Welche Farbe?)

Vor allem der Teil mit der Transparentfarbe leuchtet mir absolut nicht ein.
MiChri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 28

Win XP, Win 2000, Win 98, Linux
D4 Prof
BeitragVerfasst: Fr 17.03.06 10:12 
Hallo
Hast du schonmal daran gedacht die Corel-interne Scriptsprache (ja nachdem Corel-Script oder VBA) zu benutzen? Dann siehts garantiert aus wie in Corel ;-)
Gruß
Christian
aliB Threadstarter
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 29

ccux Linux, Windows XP SP2

BeitragVerfasst: Fr 17.03.06 16:59 
Ne, mit Corel könnt ich das zwar machen, will es aber selber machen.
Ich wollt schon immer wissen wie das geht. Ein bischen lernen schadet nie.
Hab einige Dokumentationen zum Thema Grafikbearbeitung gefunden.
Acker die mal durch, mal sehen, vieleicht taugen die was.
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Sa 18.03.06 10:51 
Hallo,

So meinte ich dies:
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:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
unit BilSchatten1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure ErstelleSchattenBild(       inBild:TBitMap;
                                 var outBild:TBitmap;
                               SchattenFarbe,
                            TransparentFarbe:TColor;
                                       Rand :integer
                                blCopyInBild:Boolean   );
begin
with outBild do
  begin
  Transparent := True;
  height := inBild.Height+Rand;
  width := inBild.Width+Rand;
  Pixelformat := inBild.PixelFormat;
  With canvas do
    begin
    Pen.Color := SchattenFarbe;
    Brush.Color := SchattenFarbe;
    Rectangle(0,0,width,height);
    end;
  TransparentColor := TransparentFarbe;
  with canvas do
    begin
    Pen.Color := TransparentFarbe;
    Brush.Color := TransparentFarbe;
    Rectangle(width-Rand,height-Rand,width,height);
    Pen.Color := SchattenFarbe;
    Brush.Color := SchattenFarbe;
    end;
  canvas.Ellipse(width-2*Rand,height-2*Rand,width,height);
  If blCopyInBild then
    Canvas.Draw(0,0,inBild);
  Transparent := true;
  end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
  MeinBild ,
  SchattenBild : TBitMap;
  i :integer;
  GrauWert : TColor;
begin
  meinBild := TBitMap.Create;
  SchattenBild := Tbitmap.Create;
  with Meinbild do
    begin
    height := 50;
    width := 50;
    Pixelformat := pf32Bit;
    end;

  with MeinBild.Canvas do
    begin
    Pen.Color := clgreen;
    Brush.Color := Pen.Color;
    Rectangle(0,0,width,height);
    end;

  For i := 0 to 255 do
    begin
    Grauwert := Tcolor((i*256+i)*256+i);
    ErstelleSchattenBild(MeinBild,SchattenBild,Grauwert,TColor(1*256*256*256),i,true);
    Form1.Canvas.Draw(10,10,SchattenBild);
{
    // Falls TransparentFarbe in MeinBild dann
    //ErstelleSchattenBild(MeinBild,SchattenBild,Grauwert,TColor(1*256*256*256),i,false);
    //Form1.Canvas.Draw(10,10,SchattenBild);
    //Form1.Canvas.Draw(10,10,MeinBild);
}

    Button1.Caption := IntToStr(i);
    sleep(20);
    end;
 meinBild.free;
 SchattenBild.Free;
end;

end.


Form so ca 400x400 Pixel Button1 unten rechts

Gruss Horst
Jailbird
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 127

Windows XP Pro SP2
Delphi 7 Professional
BeitragVerfasst: Sa 18.03.06 11:05 
zeile 82 würd ich mal ändern auf For i := 255 downto 0 do. Dann sieht man besser, was Horst meint ;)

_________________
Jailbird
aliB Threadstarter
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 29

ccux Linux, Windows XP SP2

BeitragVerfasst: Di 21.03.06 09:03 
:zustimm: :zustimm: :zustimm:
Absolut klasse der Code.
Jetzt muss ich nur noch verstehen was du da gemacht hast. ;)

ErstelleSchattenbild erzeugt mir das gesamte Bild inklusive Schatten.
Dazu setzt du zunächst die Breite auf die Breite des Originals + einen möglichen Rand.
Dieses "Schattenbild" erzeugst du 256 mal in einer For-Schleife und lässt dabei den Rand und immer kleiner und dunkler werden.

Hab ich das jetzt verstanden?
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Di 21.03.06 10:12 
Hallo,

ich hoffe ja ;-)
Aber wie entsteht das Schattenbild?
Ich faerbe das Schattenbild komplett in Schattenfarbe.(pen.color = brush.color)
Dann zeichne ich ein kleines Quadrat in der TransparentMaskenFarbe unten rechts.
Darueber pinsele ich einen gefuellten Kreis in Schattenfarbe, sodass nur unten rechts ein konkaves Dreieck in TranparentMaskenFarbe verbleibt.
Nun, auf Wunsch das Ausgangsbild in das Schattenbild oben links kopieren oder auch nicht, falls die Transparentfarbe im Originalbild vorkommt.

So wie ich das geschrieben habe. Ist der Rand erst dunkel(Grauwert nahe schwarz) und wird mit zunehmenden Rand immer heller, bis er schlussendlich weiss ist.

Gruss Horst
P.S.: Du kannst natuerlich jede von der Transparentfarbe unterscheidbare Farbe nehmen.
z:B. TransparentFarbe := TColor(NOT(integer(Schattenfarbe));