Delphi-PRAXiS
Seite 2 von 4     12 34      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Teile eines images kopieren und in anderes image einfügen (https://www.delphipraxis.net/24645-teile-eines-images-kopieren-und-anderes-image-einfuegen.html)

Nicodius 23. Jun 2004 21:26

Re: Teile eines images kopieren und in anderes image einfüge
 
"var
a,b : Trect;
begin
a := rect(0,105,0,0);
b := rect(0,105,0,0);
image2.canvas.CopyRect(a,image1.picture.bitmap.can vas,b);
end;"

das kann ja nicht gehn :? a, b nehmen das ganze ja von der canvas des Forms!

du musst es mit einem Rect AUS dem image nehmen :stupid:

Keldorn 23. Jun 2004 21:26

Re: Teile eines images kopieren und in anderes image einfüge
 
Hallo

Zitat:

a := rect(0,105,0,0);
jetzt gugg dir mal an, wie ein trect aussieht und auch, wie das rect im Beipsiel in der Hilfe aussieht.
wenn du für left und right 0 angibst, was glaubst du wird kopiert, eine spalte mit 0Pixeln-breite ? Der code ist richtig, nur definierst du das rechteck falsch.

Mfg Frank

jAcK oRsEn 23. Jun 2004 21:27

Re: Teile eines images kopieren und in anderes image einfüge
 
und wie mach ich das?

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
a,b : Trect;
begin
a := rect(0,0,105,105);
b := rect(0,0,105,105);
image2.canvas.CopyRect(a,image1.picture.bitmap.canvas,b);
end;
geht auch nicht

supermuckl 23. Jun 2004 21:29

Re: Teile eines images kopieren und in anderes image einfüge
 
:kotz:

Nicodius 23. Jun 2004 21:30

Re: Teile eines images kopieren und in anderes image einfüge
 
ok dann halt der code ...

Delphi-Quellcode:
var i,j:integer;
    Bild,teilBild:TBitmap;


Bild:=TBitmapo.create();
bild.loadfromfile('c:\....');
For i:=0 to AnzahlX do
  For j:=0 to ANzahlY do
    begin
       teilBild:=TBitmap.create();
       teilbild.copyrect(round(bild.width/AnzahlX*i),round(bild.height/AnzahlY*j),
                         round(bild.width/AnzahlX*(i+1)),round(bild.height/AnzahlY*(j+1),
                         bild);
       teilbild.savetofile(....);
       teilbild.free;
    end;

Keldorn 23. Jun 2004 21:30

Re: Teile eines images kopieren und in anderes image einfüge
 
Delphi-Quellcode:
a := rect(100,100,200,200);
b := rect(links,oben,rechts,unten);
ist das wirklich so schwer?

Nicodius 23. Jun 2004 21:31

Re: Teile eines images kopieren und in anderes image einfüge
 
aber er braucht es auch vom image das ist sein problem s.h mein post)

jAcK oRsEn 23. Jun 2004 21:33

Re: Teile eines images kopieren und in anderes image einfüge
 
mah, das funktioniert nicht, und ich verstehe es nicht

Nicodius 23. Jun 2004 21:33

Re: Teile eines images kopieren und in anderes image einfüge
 
:cry: ich kann auch nicht mehr amchen als das posten was bei mir geht :|

Nicodius 23. Jun 2004 21:34

Re: Teile eines images kopieren und in anderes image einfüge
 
aso du musst natürlich kein bmp machen ich hab den code nur von nem prog kopiert


du nimmst statt bild zb image 1 :roll:


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:59 Uhr.
Seite 2 von 4     12 34      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz