Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 27.07.05 11:34 
Wie kann ich ein BMP bei annehmbarer Qualität verkleinern??
Hab hier im Forum und bei Google zwar viel gefunden, aber nicht was wirklich brauchbar war.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 27.07.05 11:38 
Meinst du die Dateigröße kleiner machen, oder die Bildausmaße verkleinern (Breite/Höhe)?

_________________
We are, we were and will not be.
-delphin-
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: Mi 27.07.05 11:38 
mit Paint?
Stübi
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 331

Win XP, Win 2000, Win ME
D5 Ent, D7 Prof, D2005 PE, C#
BeitragVerfasst: Mi 27.07.05 11:43 
Hallo

Versuchs mal mit Invan View oder Irnvan View einfach mal googeln. Ich weiss einfach nicht genau ob der auch bmp's unterstützt.

Gruss Stübi

_________________
Neun von zehn Stimmen in meinen Kopf sagen, dass ich nicht verrückt sei. Die zehnte summt die Tetrismelodie.
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: Mi 27.07.05 12:04 
Das ist keine OffTopic Frage, also muß er das Verkleinern mit Delphi meinen.

_________________
Popov
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 27.07.05 12:35 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure MachKlein(Bitmap:TBitmap;const NeueBreite, NeueHoehe: integer);
var TempBitmap:TBitmap;
begin
 TempBitmap:=TBitmap.Create;
 with TempBitmap do try
  Width:=NeueBreite;
  NeueHoehe:=NeueHoehe;
  Canvas.CopyMode:=srcCopy;
  Canvas.CopyRect(Rect(0,0,Width,Height), Bitmap.Canvas, Rect(0,0,Bitmap.Width,Bitmap.Height));
  Bitmap.Assign(TempBitmap);
 finally
  Free;
 end;
end;


Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
mehmeh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 97

WIN XP
D5 Prof
BeitragVerfasst: Mi 27.07.05 12:40 
ich denk mal es ist die Bildgröße gemeint

Vielleicht ginge es ja mit einem Image und der eigenschaft onStartDrag, dann könnte man die Größe vielleicht mit der Maus ändern. Oder nicht?
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 27.07.05 13:09 
war ich so undeutlich ??*g*
Es geht drum dass ich in meinem Prog. JPEG´s einlese, verkleinere (physische Grösse und Speicherplatz) und dann speichere zum Weiterverarbeiten.
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: Mi 27.07.05 13:11 
user profile iconcsigg hat folgendes geschrieben:
war ich so undeutlich ??*g*

Es geht drum dass ich in meinem Prog. JPEG´s einlese,


Eigentlich ja

user profile iconcsigg hat folgendes geschrieben:
Wie kann ich ein BMP bei annehmbarer Qualität verkleinern??

_________________
Popov
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 27.07.05 13:21 
Das war ja nur zur erklärung der Situation.

In einem vorigen Thread hab ich mir erklären lassen dass ich das bmp leichter bearbeiten kann. Drum wird bei mir das JPEG erst als BMP umgewandelt
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mi 27.07.05 13:34 
Liest Du Dir auch deine vorigen Threads Durch ?!
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 27.07.05 16:26 
Ja, hab aber nix gefunden, ws einigermassen brauchbare ergebnisse liefert.
Und mit Antworten "such mal" komm ich auch nciht weiter, siehe Anfang Topic
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Mi 27.07.05 16:37 
Verusche es mal mit der GDI-Funktion StretchDraw (Unit Windows).
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mi 27.07.05 18:22 
user profile iconcsigg hat folgendes geschrieben:
Wie kann ich ein BMP bei annehmbarer Qualität verkleinern??
Hab hier im Forum und bei Google zwar viel gefunden, aber nicht was wirklich brauchbar war.


glaub ich dir nicht. Dazu gab es schon oft Beiträge. gugg nach Suche in: Delphi-Forum, Delphi-Library INTERPOLATION, in den opensource-sparten ist auch ein Beispiel für eine lineare Interpolation von Andreas Pfau, für einfache Verkleinerungen (bis ca. 70% der originalgröße ist das auch völlig ok). für stärke Verkleinerungen liefern bikubische oder Lanczos3-Algos bessere Resultate.
Achso: wenn du nach interpolation suchst, wirst du oft auf die graphics32-lib verwiesen. (www.g32.org), diese hat bereits die obengenannten Algos implementiert, dort gibt es auch ein Demo, was sich mit dem Resampling beschäftigt.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 27.07.05 18:34 
user profile iconmaxk hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure MachKlein(Bitmap:TBitmap;const NeueBreite, NeueHoehe: integer);
var TempBitmap:TBitmap;
begin
 TempBitmap:=TBitmap.Create;
 with TempBitmap do try
  Width:=NeueBreite;
  NeueHoehe:=NeueHoehe;
  Canvas.CopyMode:=srcCopy;
  Canvas.CopyRect(Rect(0,0,Width,Height), Bitmap.Canvas, Rect(0,0,Bitmap.Width,Bitmap.Height));
  Bitmap.Assign(TempBitmap);
 finally
  Free;
 end;
end;


Gruß,
maxk

habs etwas korrigiert und stretchdraw anstatt CopyRect genommen, mit bitblt hab ichs nicht hinbekommen, so funzt es, aber die qualität ist zum kotzen :puke: :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure SizeBMP(Bitmap: TBitmap; const NewWidth, NewHeight: integer);
var
  TempBMP: TBitmap;
  Rect: TRect;
begin
  TempBMP := TBitmap.Create;
  with TempBMP do
    try
      Width := NewWidth;
      Height := NewHeight;
      Rect.Left := 0;
      Rect.Top := 0;
      Rect.Right := width;
      Rect.Bottom := Height;
      TempBMP.Canvas.StretchDraw(Rect, Bitmap);
      Bitmap.Assign(TempBMP);
    finally
      Free;
    end;
end;


MFG

F34r0fTh3D4rk ;)