Autor Beitrag
der_zaehe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 317

WinXP SP2
D6 Pers, D2005 Prof, VS2005
BeitragVerfasst: So 15.01.06 23:57 
Ich habe mir eine neue Klasse von TForm abgeleite:
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:
unit BCForm;

interface

uses
  Classes, Graphics, Forms,ExtCtrls,Windows;

type TBCForm = class(TForm)
       constructor BCCreate(AOwner: TComponent;pWidth,pHeight: Integer);
       destructor Destroy; override;
     private
       background: TImage;
     end;


implementation

constructor TBCForm.BCCreate(AOwner: TComponent;pWidth,pHeight: Integer);
var
  buffer: TPicture;
begin
  inherited Create(AOwner);
  self.Width := pWidth;
  self.Height := pHeight;
  buffer := TPicture.Create;
  background := TImage.Create(self);
  background.Width := self.Width;
  background.Height := self.Height;
  background.Picture.Bitmap.Canvas.FloodFill(1,1,clWhite,fsSurface);
  background.Picture.Bitmap.Canvas.Pen.Color := RGB(159,159,159);
  background.Picture.Bitmap.Canvas.Rectangle(0, 0, self.Width, self.Height);
  buffer.Bitmap.LoadFromResourceName(HINSTANCE,'AlphaMitRand_Ecke_lo');
  background.Picture.Bitmap.Canvas.Draw(0,0,buffer.Graphic);
  buffer.Bitmap.LoadFromResourceName(HINSTANCE,'AlphaMitRand_Ecke_ro');
  background.Picture.Bitmap.Canvas.Draw(Width-20,0,buffer.Graphic);
  buffer.Bitmap.LoadFromResourceName(HINSTANCE,'AlphaMitRand_Ecke_lu');
  background.Picture.Bitmap.Canvas.Draw(Width-20,Height-20,buffer.Graphic);
  buffer.Bitmap.LoadFromResourceName(HINSTANCE,'AlphaMitRand_Ecke_ru');
  background.Picture.Bitmap.Canvas.Draw(0,Height-20,buffer.Graphic);
  buffer.Destroy;
  self.TransparentColorValue := clBlue;
  self.TransparentColor := TRUE;
end;

destructor TBCForm.Destroy;
begin
  background.Destroy;
  inherited Destroy;
end;

end.


wenn ich in einen anderem Formular per
ausblenden Delphi-Quelltext
1:
  Form3 := TBCForm.BCCreate(self,300,300);					

eine neue instanz der klasse erzeugen möchte, erhalte ich die fehlermeldung: "Ressource TBCForm wurde nicht gefunden".
woran könnte das liegen? ich habe keine ahnung.

schon mal danke für die hilfe.
der_zaehe

_________________
[inspirationslos]
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 16.01.06 08:31 
schreib mal hinter
ausblenden Delphi-Quelltext
1:
2:
3:
implemnetation

{$R BCForm.Res}


oder wo deinen Bilder auch herkommen
und
statt TPicture für Buffer nimm doch gleich TBitmap
und
es sollte .Free und nicht .Destroy heißen!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!