Autor Beitrag
Ak-Alex
Gast
Erhaltene Danke: 1



BeitragVerfasst: Do 08.05.03 15:09 
Hi,


wie kann ich ein Bild in der Ansicht verkleinern ohne was abzuschneiden.....?
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Do 08.05.03 15:16 
was verstehst du unter einem bild? TImage, TBitmap, bmp, png, jpg, gif, DIB...?

_________________
mfg.
mâximôv
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Do 08.05.03 15:48 
Wenn du die Image-Komponente von Delphi benutzt, die hat die Eigenschaft Stretch. Wenn du die auf True setzt, wird das geladene Bild in das Image "gezerrt", also bleibt es komplett erhalten, sieht aber u.U. nicht mehr gut aus. -> So wie die Einstellung "gestreckt" in der Windows-Anzeige. :-)

_________________
Hasta La Victoria Siempre
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Di 23.03.04 17:58 
Terra23 hat folgendes geschrieben:
wird das geladene Bild in das Image "gezerrt", also bleibt es komplett erhalten, sieht aber u.U. nicht mehr gut aus.

Kann man auch irgendwie mit Antialias, also smooth stretchen?

Danke, Jens.
Beliar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Do 25.03.04 00:28 
Kann man - mit Photoshop :lol:
Sonst wüsst ich auch nicht wie
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 25.03.04 00:42 
Schau mal bei g32.org (ohne www). Dort gibt es eine Library (Graphics32), welche verschiedene Verfahren zum resizen von Bildern zur Verfügung stellt. Suche in der beiligenden Hilfedatei nach StretchTransform. Ich setze die Bibl. beispielsweise in meinem PL's Pixit (Freeware-Sparte) ein.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
NetFalcon
ontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 59

Guitar Player

BeitragVerfasst: Do 25.03.04 01:11 
ich schau mal nach dem quelltext
hab ich mal programmiert
ist aber auhc schon so spät...

ausblenden volle Höhe 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:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
function ResizeBmp(bitmp: TBitmap; wid, hei: Integer): Boolean; 
var  
  TmpBmp: TBitmap; 
  ARect: TRect; 
begin 
  Result := False; 
  try 
    TmpBmp := TBitmap.Create; 
    try 
      TmpBmp.Width  := wid; 
      TmpBmp.Height := hei; 
      ARect := Rect(0,0, wid, hei); 
      TmpBmp.Canvas.StretchDraw(ARect, Bitmp); 
      bitmp.Assign(TmpBmp); 
    finally 
      TmpBmp.Free; 
    end
    Result := True; 
  except 
    Result := False; 
  end
end;

function Bmp2Jpg(const ABmp: TBitmap; AQuality: Integer): TJPEGImage;
type
 TJPEGQualityRange = 1..100;
var bmp : TBitmap;
   Jpg : TJpegImage;
begin
 bmp := TBitmap.Create;
 jpg := TJpegImage.Create;
 try
  // bmp.LoadFromFile (FileName);
   Jpg.CompressionQuality := AQuality;
   Jpg.Assign(Abmp);
   Jpg.SaveToFile ( ChangeFileExt('C:/Screen''.jpg' ));
 finally
   jpg.Free;
   bmp.Free;
 end;
end;



procedure TForm1.Button1Click(Sender: TObject);
   var
  Bitmap: TBitmap;
  DeskWh: HWND;
  DeskDC: HDC;
  DeskRc: TRect;
begin

    DeskWh := GetDesktopWindow;
    DeskDC := GetDC(DeskWh);
    GetWindowRect(DeskWh, DeskRc);
    Bitmap := TBitmap.Create;
    try
       Bitmap.Width  := DeskRc.Right  - DeskRc.Left;
       Bitmap.Height := DeskRc.Bottom - DeskRc.Top;
       BitBlt(Bitmap.Canvas.Handle, 00, Bitmap.Width, Bitmap.Height,
       DeskDC, 00, SRCCOPY);
    ResizeBmp(Bitmap , 426 , 341);

       {  StretchBlt(Bitmap.Canvas.Handle, 0, 0, 256, 320,
             DeskDC, 0, 0, 256, 320, SRCCOPY); }


     //  bitmap. := 256;
   //    bitmap.Width :=     320;
      //   Bitmap.SaveToFile('c:\screen.bmp');

       Bmp2Jpg(Bitmap,44);

    finally
       ReleaseDC(DeskWh, DeskDC);
       bitmap.Free;
    end;

end;



Hier bitte der Quellcode eines Programmes, dass den Bildschirm foto macht, verkleinert und sogar die qualität ändert und dann in ein jpg umwandelt

Mehr kann man garnicht wollen

Gähn gute nacht

Moderiert von user profile iconPeter Lustig: Code- durch Delphi-Tags ersetzt
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 25.03.04 01:33 
StretchDraw liefert oft recht unschöne Ergebnisse. Daher gibt es ja auch Algorithmen, um die Größe von Bildern zu ändern. :-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Do 25.03.04 09:20 
Danke,

diese g32.org - Packages sind wirklich gut. 8) Respekt vor Leuten, die sowas entwickeln und dann auch noch als Freeware zur Verfügung stellen. :D

Gruß Jens.
Bumpy Johnson
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Di 29.03.05 14:59 
hi leute,

ich hab mir auch mal das Graphics32 Paket runtergeladen. Ich finde es auch echt klasse, bloß hab ich noch mal ein Frage. Ich würde gerne ein Bild(Dateigröße) verkleinern. Das ganze mache ich gerade mit der ganz normalen Funktion von Tbitmap (Compress und CompressQuality) Leider ist die Qualität nicht das was ich will...

Geht das auch mit Graphics32?

_________________
-Bumpy Johnson
rest in Peace
Ist die Frage beantwortet? Das Problem gelöst?

Dann klicke hier, um das Thema entsprechend zu markieren!