klik di bawah ini

Selasa, 28 Juni 2011

how to make an application to convert an image / photo to grayscale and RGB image rotation with squash in linux



Finally
I was ready for duty, probably because I keep looking for ya time .. hehe .. a few weeks ago I got an assignment from the faculty of informatics engineering university lecturer white elephant Takengon to create an application that is his conversion to RGB color images / pictures to grayscale, and should also be made ​​to rotate the image, and it should all be done in linux operating system, and I tried to make his SQUASH,,

hmm ...

ni now I'm confused, what might it be for this application SKRIPSI later ...

ahh .. it later lah ..

are important now I want to share knowledge with colleagues all ...

maybe if kawan2 want to find ways to make an application to convert color images to grayscale with Visual Basic or VB .. just click on siniTautan

and here's how to make an application to convert an RGB color image to grayscale with Gambas ..

create a form like the picture above and Provide
5 pieces button, a picture box

changed as below

button1 : name bsearch, caption open

button2 : name bblack, caption konversi

button3 : name brotate, caption rotasi

button4 : name bmirror, caption kembali

button5 : name bquit, caption quiter

picturebox1 : name ppicture


Copied
the script below:


' Gambas class file
PUBLIC nomfichier AS String
PUBLIC myimg AS Image
PUBLIC SUB _new()

END

PUBLIC SUB Form_Open()
ME.Center
END

PUBLIC SUB bquit_Click()
ME.Close
END

PUBLIC SUB Menu2_Click()
bquit_Click
END



PUBLIC SUB bsearch_Click()

Dialog.Filter = ["*.jpg", "Fichiers JPEG", ".png", "Fichiers PNG", ".xpm", "Fichiers XPM"]
Dialog.Title = "Ouvrir une photo d'identite"
Dialog.Path = Application.Path

IF Dialog.OpenFile() THEN RETURN
IF Dialog.Path <> "" THEN
brotate.Enabled = TRUE
bblack.Enabled = TRUE
bmiror.Enabled = TRUE
ENDIF
nomfichier = Dialog.Path
myimg = Image.Load(nomfichier)
ppicture.Picture = myimg.Picture
END

PUBLIC SUB bblack_Click()
myimg.Gray
ppicture.Picture = myimg.Picture
END

PUBLIC SUB brotate_Click()
myimg = myimg.Rotate(1.57)
ppicture.Picture = myimg.Picture
END

PUBLIC SUB bmiror_Click()
myimg = Image.Load(nomfichier)
ppicture.Picture = myimg.Picture
END

PUBLIC SUB Button1_Click()
IF myimg = NULL THEN RETURN
myimg.Resize(90, 128)
fplanche.drawallpicture(myimg)
END

Doubleclick on the form blank and paste the above script run by pressing F5 .. ..
I managed to run ..
I hope you too ..
good luck ..


Related Article:

0 komentar:

Posting Komentar


 

Teman-teman