Autor Beitrag
delphijanka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Fr 08.09.06 01:09 
hi.
Ja, ich möchte Bilder vom Format TIF bzw BMP ins JPG umwandeln. Mit BMP is ja noch kein Problem, aber TIF...
Danke für euere Hilfe.
n-regen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 202
Erhaltene Danke: 2



BeitragVerfasst: Fr 08.09.06 10:35 
Ich glaube, es gibt da eie ActiveX-Komponente TImageConvert oder so.
Mit der gehts wahrscheinlich.
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Fr 08.09.06 12:16 
Ich verwende die LibTiff.
So kannst du die TIF in ein BMP umwandeln, die kannst du dann in JPG umwandeln:
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:
function ReadTiffIntoBitmap(Filename: String): TBitmap;  
var  
  OpenTiff: PTIFF;  
  FirstPageWidth,FirstPageHeight: Cardinal;  
  FirstPageBitmap: TBitmap;  
begin  
  OpenTiff := TIFFOpen(Filename,'r');  
  if OpenTiff = nil then raise Exception.Create(  
    'Unable to open file '''+Filename+'''');  
  TIFFGetField(OpenTiff, TIFFTAG_IMAGEWIDTH, @FirstPageWidth);  
  TIFFGetField(OpenTiff, TIFFTAG_IMAGELENGTH, @FirstPageHeight);  
  FirstPageBitmap := nil;  
  try  
    FirstPageBitmap := TBitmap.Create;  
    FirstPageBitmap.PixelFormat := pf32bit;  
    FirstPageBitmap.Width := FirstPageWidth;  
    FirstPageBitmap.Height := FirstPageHeight;  
  except  
    if FirstPageBitmap <> nil then FirstPageBitmap.Destroy;  
    TIFFClose(OpenTiff);  
    raise Exception.Create('Unable to create TBitmap buffer');  
  end;  
  TIFFReadRGBAImage(OpenTiff, FirstPageWidth, FirstPageHeight,  
    FirstPageBitmap.Scanline[FirstPageHeight - 1], 0);  
  TIFFClose(OpenTiff);  
  TIFFReadRGBAImageSwapRB(FirstPageWidth, FirstPageheight,  
    FirstPageBitmap.Scanline[FirstPageHeight - 1]);  
  Result := FirstPageBitmap;  
end;
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Fr 08.09.06 13:59 
PTIFF = Fehler..
irgendwelche Uses einfügen ?
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Fr 08.09.06 14:03 
Jo, er hat doch gesacht, dass er die LibTiff verwendet. :mrgreen:


Zuletzt bearbeitet von Danniolo am Fr 08.09.06 17:14, insgesamt 1-mal bearbeitet
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 08.09.06 14:12 
gibst auf [url]www.dsdt.info[/url] nicht nen code dafür? unter Tipps und Trick glaub ich (hab mir die Ganzen beiträge mal ausgedruckt :-D)

mfg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Fr 08.09.06 14:52 
Hier steht doch alles dran wie's geht :!:
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: So 10.09.06 11:48 
danke für euere Beiträge.

Ich habe ein Problem mit LibTiff, nämlich wie ich verstanden habe, gehts mit >= Delphi 6, ich habe Delphi5. Und ausserdem habe ich Schwierigkeiten mit English.

@ Elundril:

Ich habe auf der Page gekuckt, steht bei "Bildkonvertierungen" nur BitMap und JPEG. Wo hast du es genau gefunden?
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: So 10.09.06 12:10 
sorry hab mich leider geirrt! tut mir wirklich leid! hab auch im google schon danach gesucht aber nix brauchbares gefunden! Ich such weiter und schreib dir dann!

mfg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: So 10.09.06 19:42 
hat jemand eine andere Idee?
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Mo 11.09.06 16:51 
user profile icondelphijanka hat folgendes geschrieben:
Ich habe ein Problem mit LibTiff, ...

Kannst du uns die genauen Fehler zeigen? Manchmal lässt sich etwas ein bisschen ändern, sodass es auch mit Delphi 5 geht.
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Di 12.09.06 15:28 
ja, das Problem ist mit "PCardinal", das kennt mein Delphi5 nicht.

wie sieht die aus?
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Di 12.09.06 15:30 
kann mir jemand Delphi6 uploaden? :D
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 12.09.06 15:32 
PCarinal müsste so definiert sein:

ausblenden Delphi-Quelltext
1:
PCandinal = ^Cardinal					

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Di 12.09.06 15:35 
Bei Mike Lischke gibt es auch eine Unit dafür, die kann noch einiges mehr. Vielleicht overkill nur für TIF...

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: So 17.09.06 13:21 
könnte mir plz jemand das Programm machen, welches Tiff in JPEG oder BitMap umwandelt?
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Mo 18.09.06 20:39 
Versuch es erst mal selbst, und zeig uns dann deinen Code, wenn du nicht weiterkommst. Ich glaube kaum, dass dir jemand einfach so ein Prog programmiert. Alle Prozeduren die du brauchst haben wir dir schon gegeben. Jetzt fang mal an, und dann sehen wir weiter :o
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Fr 22.09.06 16:52 
Chryzler, ich schätze deine Hilfsbereitschaft.
Doch denk mal als Informatiker nach, ist es schneller, ein Proramm in Delphi 6 oder höher mit diesen fertigen LibTiff Komponenten in max 20 min zu schreiben, oder unendlich lang rumdiskutieren, was man so alles neudefinieren, umschreiben, ändern, Fehler suchen muss.....etc...
Ich habe es mit LibTiff ausprobiert, am Anfang habe ich dann eniges geändert, doch dann muss aber noch vieles anderes mehr geändert werden, und das nimmt sehr viel ZEit, welche ich leider nicht habe.
Ich suche lieber Delphi6....
Freiberger
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

WIN XP
Delphi 7
BeitragVerfasst: Mi 07.11.07 17:56 
Titel: TIF nur anzeigen
Hallo,

Ich nutze auch die LibTiff, habe aber folgendes Problem:
Ich habe TIF-Dateien mit mehr als 10000 Pixel Breite.(sw)
Wenn ich diese als BMP umwandle, macht er mir das in 32Bit.
Da will mein Rechner nicht mitmachen, da die BMP über 100MB groß wird.
Um mal schnell ein TIF anzuzeigen, ist es also nicht so schön.

Kann man mit OpenTiff := TIFFOpen(Filename,'r');
das TIF nicht irgendwie anzeigen, ohne es umzuwandeln ?
z.B. auf nem Panel oder so ???Mit Handle oder Pointer ???

Bin für jede Hilfe dankbar...
Freiberger
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

WIN XP
Delphi 7
BeitragVerfasst: Do 14.02.08 21:55 
Titel: TIF als Vorschau
Kann man eine TIF-Datei irgendie als Thumbnail-Vorschau anzeigen, ohne sie komplett zu laden ?