Autor Beitrag
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Do 16.08.07 13:13 
HI,

ich hab mir vor kurzem ein PuzzleSpiel geschreiben, bei
dem man Bilderin ein Puzzle umwandeln und dann spielen kann.
Da ich aber mit CopyRect arbeite kann ich nur BMPs benutzen.
Deshalb wollte ich wissen wie ich JPGs in eine BMP umwandeln
kann. Wenn ich da so mach kommt am ende Bitmap nicht gültig.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
if OpenDialog.FileName <> '*.bmp' then 
  begin
    Image.Picture.LoadFromFile(OpenDialog.FileName),
    Image.Picture.SaveToFile('temp.bmp');
    Image.Picture.LoadFromFile('temp.bmp');
  end;


MfG Bergmann.

Moderiert von user profile iconUGrohne: Zweite Frage entfernt.
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Do 16.08.07 13:55 
Ich glaub das ging irgendwie so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var jpg : TJpegImage;
    bmp : TBitmap;

// hier irgendwie jpg laden

bmp := TBitmap.Create;
bmp.Assign(jpg);
jpg.Free;

// jetzt ists umgewandelt
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Do 16.08.07 14:41 
Den Thread gabs schonmal: von robox
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Do 16.08.07 18:02 
Alles klar, jetzt gehts. THX