Autor Beitrag
BigBasti
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 45

Win XP
D7
BeitragVerfasst: Mi 16.03.05 20:40 
hallo! ich verwende momentan bitmaps um grafiken im programm einzusetzen, möchte aber auf jpeg, aufgrund des geringeren speicherplatzbedarfes umsteigen. mit welchen (möglichst einfachen befehlen) kann ich das erreichen?

als vergleich die befehle, die ich momentan verwende:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
var bild:tbitmap;
begin
     bild:=tbitmap.create;
     bild.loadfromfile('Bild1.bmp');
     form1.canvas.draw(0,0,bild);
end;
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: Mi 16.03.05 20:52 
Die Unit jpeg einbinden und die Delphi-OH zu dieser Unit konsultieren ;)

AXMD
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 16.03.05 21:09 
Nun ja... Ich würde sagen fast genauso... ;)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.FormCreate(Sender: TObject);
var
Bild: TJPEGImage;
begin
Bild := TJPEGImage.Create;
Bild.LoadFromFile('Bild1.jpg');
Form1.Canvas.Draw(0, 0, Bild);
end;
Arnulf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Do 17.03.05 00:43 
Ich glaub das stimmt nicht ganz.
man kann im canvas kein jpg anzeigen.

das stimmt:
ausblenden Delphi-Quelltext
1:
2:
Bild := TJPEGImage.Create;  
Bild.LoadFromFile('Bild1.jpg');


aber bild muß man dann in ein bitmap convertieren.
danach kannst das im canvas anzeigen soweit ich weiß.

aber nicht schlagen wenns nicht stimmt - ich programmier erst seit 3 monaten mit delphi.

Arnulf
BigBasti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 45

Win XP
D7
BeitragVerfasst: Do 17.03.05 17:32 
mh is doch schon mal ein anfang! :)

und wie kann ich den ganzen spass dann in ein bitmap konvertieren?
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 17.03.05 17:39 
Es funktioniert also nicht??
BigBasti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 45

Win XP
D7
BeitragVerfasst: Do 17.03.05 17:52 
nun ja, mein delphi meckert über den "undefinierten bezeichner 'TJPGImage'" (sowohl auf d5 als auch auf d7)

was mach ich denn falsch? muss ich noch irgendwas unter uses nachtragen??
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 17.03.05 17:58 
Hast du oben bei uses JPEG dazugeschrieben??
BigBasti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 45

Win XP
D7
BeitragVerfasst: Do 17.03.05 20:29 
super jetzt funktionierts! vielen dank für die hilfe!
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 17.03.05 20:31 
kP... 8)

:rofl: cu *g*