function varargout =
Sisipan(varargin)
% SISIPAN
MATLAB code for Sisipan.fig
% SISIPAN, by itself, creates a new SISIPAN
or raises the existing
% singleton*.
%
% H = SISIPAN returns the handle to a new
SISIPAN or the handle to
% the existing singleton*.
%
%
SISIPAN('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SISIPAN.M with
the given input arguments.
%
% SISIPAN('Property','Value',...) creates a
new SISIPAN or raises the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before
Sisipan_OpeningFcn gets called. An
% unrecognized property name or invalid
value makes property application
% stop.
All inputs are passed to Sisipan_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools
menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See
also: GUIDE, GUIDATA, GUIHANDLES
% Edit the
above text to modify the response to help Sisipan
% Last
Modified by GUIDE v2.5 19-Dec-2011 12:45:49
% Begin
initialization code - DO NOT EDIT
gui_Singleton =
1;
gui_State =
struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn',
@Sisipan_OpeningFcn, ...
'gui_OutputFcn', @Sisipan_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin
&& ischar(varargin{1})
gui_State.gui_Callback =
str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] =
gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End
initialization code - DO NOT EDIT
% ---
Executes just before Sisipan is made visible.
function
Sisipan_OpeningFcn(hObject, eventdata, handles, varargin)
% This
function has no output args, see OutputFcn.
%
hObject handle to figure
% eventdata reserved - to be defined in a future version
of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
%
varargin command line arguments to
Sisipan (see VARARGIN)
% Choose
default command line output for Sisipan
handles.output =
hObject;
% Update
handles structure
guidata(hObject,
handles);
% UIWAIT
makes Sisipan wait for user response (see UIRESUME)
%
uiwait(handles.figsisipan);
% ---
Outputs from this function are returned to the command line.
function varargout =
Sisipan_OutputFcn(hObject, eventdata, handles)
%
varargout cell array for returning
output args (see VARARGOUT);
%
hObject handle to figure
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
% Get
default command line output from handles structure
varargout{1} =
handles.output;
% ---
Executes on button press in btnstego.
function
btnstego_Callback(hObject, eventdata, handles)
%
hObject handle to btnstego (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
proyek=guidata(gcbo);
I=get(proyek.GbrAsli,'Userdata');
pesan=get(proyek.listbox1,'Userdata');
pesan=[pesan 'QQQQ'];
% 'QQQQ' tanda akhir dari suatu pesan
teksbin=str2bin(pesan);
gbr2=stegolsb(I,teksbin);
set(proyek.figsisipan,'CurrentAxes',proyek.GbrStego);
set(imshow(gbr2));
set(proyek.GbrStego,'Userdata',gbr2);
% ---
Executes on button press in btnsimpangbr.
function btnsimpangbr_Callback(hObject,
eventdata, handles)
%
hObject handle to btnsimpangbr (see
GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
proyek=guidata(gcbo);
[namafile,direktori]=uiputfile('*.bmp','Simpan
Gambar');
gbr2=get(proyek.GbrStego,'Userdata');
imwrite(gbr2,namafile);
% ---
Executes on button press in btnbukagbr.
function
btnbukagbr_Callback(hObject, eventdata, handles)
%
hObject handle to btnbukagbr (see
GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
proyek=guidata
(gcbo);
[namafile,direktori]=uigetfile({'*.jpg';'*.bmp';...
'*.png';'*.tif'}, 'Buka Gambar');
I=imread(namafile);
set (proyek.figsisipan,'CurrentAxes',proyek.GbrAsli);
set (imshow(I));
set
(proyek.GbrAsli,'Userdata',I);
% ---
Executes on button press in btnbukateks.
function
btnbukateks_Callback(hObject, eventdata, handles)
%
hObject handle to btnbukateks (see
GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
proyek=guidata(gcbo);
[namafile,direktori]=uigetfile('*.txt','Buka Teks');
teks=fopen(namafile,'r');
charteks=fread(teks,'uint8=>char');
fclose(teks);
pesan=sprintf(charteks);
set(proyek.listbox1,'string',pesan);
set(proyek.listbox1,'Userdata',pesan);
% ---
Executes on selection change in listbox1.
function
listbox1_Callback(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
% Hints:
contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
% contents{get(hObject,'Value')} returns
selected item from listbox1
% ---
Executes during object creation, after setting all properties.
function
listbox1_CreateFcn(hObject, eventdata, handles)
%
hObject handle to listbox1 (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles empty - handles not created
until after all CreateFcns called
% Hint:
listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc &&
isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
%
--------------------------------------------------------------------
function
file_Callback(hObject, eventdata, handles)
%
hObject handle to file (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
%
--------------------------------------------------------------------
function proses_Callback(hObject,
eventdata, handles)
%
hObject handle to proses (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
%
--------------------------------------------------------------------
function
sisipan_Callback(hObject, eventdata, handles)
%
hObject handle to sisipan (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
%
--------------------------------------------------------------------
function
ekstraksi_Callback(hObject, eventdata, handles)
%
hObject handle to ekstraksi (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
% handles structure with handles and user data (see
GUIDATA)
ekstrak
%
--------------------------------------------------------------------
function
brshgbr_Callback(hObject, eventdata, handles)
%
hObject handle to brshgbr (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
proyek=guidata(gcbo);
set(proyek.figsisipan,'CurrentAxes',proyek.GbrStego);
cla;
set(proyek.figsisipan,'CurrentAxes',proyek.GbrAsli);
cla;
%
--------------------------------------------------------------------
function
brshteks_Callback(hObject, eventdata, handles)
%
hObject handle to brshteks (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
proyek=guidata(gcbo);
pesan='';
set(proyek.listbox1,'string',pesan);
%
--------------------------------------------------------------------
function
keluar_Callback(hObject, eventdata, handles)
%
hObject handle to keluar (see GCBO)
%
eventdata reserved - to be defined in a
future version of MATLAB
%
handles structure with handles and
user data (see GUIDATA)
pilihan=questdlg(['Anda yakin
keluar dari aplikasi',...
get(handles.figsisipan,'Name'),'?'],...
['Konfirmasi Tutup'],'Ya','Tidak','Ya');
if strcmp(pilihan,'Tidak')
return;
end
delete(handles.figsisipan);
Tidak ada komentar:
Posting Komentar