Autor Beitrag
Daxten
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Sa 28.05.05 15:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.ShowStartScreen;
var NewGame: TJpegImage;
begin
  NewGame := TjpegImage.Create;
  try
    NewGame.LoadFromFile('images/neuesspiel.jpg');
    FBitmap := TBitmap.Create;
    FBitmap.Assign(NewGame);
  finally
    NewGame.free;
  end;
  Form1.canvas.draw(50,50,FBitmap);
end;


Dieser Code zeigt leider nichts an ... wodran liegt das ?
Btw. ich benutze Delphi 3 habe die unit jpeg eingebunden und FBitmap in private deklariert

Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt.
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Sa 28.05.05 20:49 
Guck dir das hier mal an:
ausblenden 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:
[...]
var
  Form1: TForm1;
  FCanvas: TControlCanvas;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
   Jpeg: TJpegImage;
begin
  Jpeg := TJpegImage.Create;
  try
    Jpeg.LoadFromFile('C:\123.jpg');
    FCanvas := TControlCanvas.Create;
    FCanvas.Control := self;
    FCanvas.Draw(0,0,Jpeg);
  finally
    Jpeg.Free;
  end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  FCanvas.Free;
end;
[...]


mfg matze

_________________
si tacuisses, philosophus mansisses.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 28.05.05 20:55 
TForm besitzt auch direkt ein Canvas, das Du benutzen kannst.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
[...]
procedure TForm1.Button1Click(Sender: TObject);
var
   Jpeg: TJpegImage;
begin
  Jpeg := TJpegImage.Create;
  try
    Jpeg.LoadFromFile('C:123.jpg');
    Canvas.Draw(0,0,Jpeg);
  finally
    Jpeg.Free;
  end;
end;
[...]


reicht dann völlig...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Sa 28.05.05 21:06 
Aso, ok man lernt nie aus ;D

mfg matze

_________________
si tacuisses, philosophus mansisses.
Daxten Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: So 29.05.05 13:08 
aaahh geil es funktioniert : )
Wie kann ich nun OnClick Events hinzufügen?
Oder wie kann ich diese Canvas nun verschieben?

(Sry wegen den noob quest's :-))
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: So 29.05.05 13:22 
user profile iconDaxten hat folgendes geschrieben:
aaahh geil es funktioniert : )
Wie kann ich nun OnClick Events hinzufügen?
Oder wie kann ich diese Canvas nun verschieben?

(Sry wegen den noob quest's :-))


Neue Frage, neues Topic

AXMD