AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Bildausschnitt mit CopyRect() in Zwischenablage
Thema durchsuchen
Ansicht
Themen-Optionen

Bildausschnitt mit CopyRect() in Zwischenablage

Ein Thema von Tobias · begonnen am 2. Dez 2004 · letzter Beitrag vom 10. Jan 2009
Antwort Antwort
Tempel

Registriert seit: 15. Jul 2004
6 Beiträge
 
#1

Re: Bildausschnitt mit CopyRect() in Zwischenablage

  Alt 17. Dez 2004, 15:02
Zitat von Pr0g:
Das wäre mir neu. Welche Delphiversion nutzt du?
5.0 Enterprise.

Aber du hast recht, die Scrollbox kommt von der Form, nicht vom TImage. Ich sollte vielleicht so sät nicht auf Beiträge antworten, sondern bis zum nächsten Tag warten

Dies hier macht auf jeden Fall Scrollbars ohne Scrollbox und das Mausrad funktioniert ohne zusätzliche Programmierung.

Man nehme ein Form mit einem TImage oben links in der Ecke, größe ist egal. Property Stretch := True;

Code:
procedure TBild.SetPictureName(NewPictureName:String);
begin
   fPictureName := NewPictureName;
   Image1.Picture.LoadFromFile(NewPictureName);
   fScale := 0;
   Rescale;
end;

procedure TBild.Rescale;
begin
   if (fScale = 1) or (fScale = -1) then fScale := 0;
   if fScale = 0 then begin
      Caption := fPicturename + ' (1:1)';
      Image1.Width := Image1.Picture.Width;
      Image1.Height := Image1.Picture.Height;
   end else if fScale > 0 then begin
      Caption := fPicturename + ' ('+IntToStr(fScale)+':1)';
      Image1.Width := Image1.Picture.Width div fScale;
      Image1.Height := Image1.Picture.Height div fScale;
   end else begin
      Caption := fPicturename + ' (1:'+IntToStr(-fScale)+')';
      Image1.Width := Image1.Picture.Width * -fScale;
      Image1.Height := Image1.Picture.Height * -fScale;
   end;
   Self.ClientWidth := Image1.Width;
   Self.ClientHeight := Image1.Height;
end;
Thomas
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:22 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz