Μανο εγω το κάνω λίγο διαφορετικά, με εναν απλο μα συνάμα διαφορετικό τρόπο,
να δες..
:P
Φτιαχνω ενα αρχειο imageConcat.java και βάζω
package gr.zenika.play.images;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class imageConcat(){
public static void main(String[] args) throws IOException, Exception {
File file1 = new File("/home/user/BlackDragonWallpaper.jpg");
File file2 = new File("/home/user/black_attack_001_1024x768.jpg");
File file3 = new
File("/home/user/windows-vista-wallpaper-120.jpg");
File file4 = new
File("/home/user/wallpapers_windows_vista-xp-longnhor_-_redcode_0051.jpg");
BufferedImage img1 = ImageIO.read(file1);
BufferedImage img2 = ImageIO.read(file2);
BufferedImage img3 = ImageIO.read(file3);
BufferedImage img4 = ImageIO.read(file4);
int widthImg1 = img1.getWidth();
int heightImg1 = img1.getHeight();
int widthImg2 = img2.getWidth();
int heightImg2 = img2.getHeight();
BufferedImage img = new BufferedImage (
widthImg1 + widthImg2, // Final image will have width and
height as
heightImg1 + heightImg2, // addition of widths and heights of
the images we already have
BufferedImage.TYPE_INT_RGB);
boolean image1Drawn = img.createGraphics().drawImage(img1, 0, 0,
null); // 0, 0 are the x and y positions
if(!image1Drawn) System.out.println("Problems drawing first
image"); //where we are placing image1 in final image
boolean image2Drawn = img.createGraphics().drawImage(img2,
widthImg1, 0, null); // here width is mentioned as width of
if(!image2Drawn) System.out.println("Problems drawing second
image"); // image1 so both images will come in same level
boolean image3Drawn = img.createGraphics().drawImage(img3, 0,
heightImg1, null);
if(!image3Drawn) System.out.println("Problems drawing third
image");
boolean image4Drawn = img.createGraphics().drawImage(img4,
widthImg1, heightImg1, null);
if(!image4Drawn) System.out.println("Problems drawing fourth
image");
// horizontally
File final_image = new File("/home/user/Final.jpg");
boolean final_Image_drawing = ImageIO.write(img, "jpeg",
final_image);
if(!final_Image_drawing) System.out.println("Problems drawing
final image");
System.out.println("Successfull");
}
}
Και μετα δίνω
javac imageConcat.java
java imageConcat
αυτα!
:p :p
Καλημερα και καλη εβδομαδα με χιουμορ σε ολους!!!!
Υ.Γ. το παραπάνω δουλευει!
*Alexius Dionysius Diakogiannis*
Software Architect/Consultant
t: 801 700 7374 / +30 211 790 3292
f: +30 211 790 3880
m: +30 6944 915 876
e: [email protected]
w: http://www.zenika.gr
2010/5/17 Emmanouil Batsis (Manos) <[email protected]>
> On 05/16/2010 09:01 PM, Jimmy Angelakos wrote:
> > O πιο απλός τρόπος είναι να τρέξεις από τερματικό:
> >
> > convert eikona1.jpeg eikona2.jpeg +append apotelesma.jpeg
> >
> >
> > Αυτό προϋποθέτει ότι έχεις εγκατεστημένο το Imagemagick (νομίζω είναι
> > προεγκατεστημένο).
>
> Πόσες ώρες μου έχει σώσει αυτό το Imagemagick...
>
>
> --
> Manos Batsis, Chief Technologist
> __ _
> ____ _/ /_ (_)_________ ____ ______
> / __ `/ __ \/ / ___/ ___// __ `/ ___/
> / /_/ / /_/ / (__ |__ )/ /_/ / /
> \__,_/_.___/_/____/____(_)__, /_/
> /____/
> http://www.Abiss.gr
> 19, Kalvou Street,
> 14231, Nea Ionia,
> Athens, Greece
>
> Tel: +30 211-1027-900
> Fax: +30 211-1027-999
>
> http://gr.linkedin.com/in/manosbatsis
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: manos.vcf
> Type: text/x-vcard
> Size: 393 bytes
> Desc: not available
> Url :
> https://lists.ubuntu.com/archives/ubuntu-gr/attachments/20100517/9889eb73/attachment.vcf
> --
> Ubuntu-gr mailing list
> [email protected]
>
> If you do not want to receive any more messages from the ubuntu-gr mailing
> list, please follow this link and choose unsubscribe:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-gr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
https://lists.ubuntu.com/archives/ubuntu-gr/attachments/20100517/b395445a/attachment.htm
--
Ubuntu-gr mailing list
[email protected]
If you do not want to receive any more messages from the ubuntu-gr mailing
list, please follow this link and choose unsubscribe:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-gr