Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gifitti
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nick Kozel
Gifitti
Commits
2dea6af3
Commit
2dea6af3
authored
8 years ago
by
Pavle Arezina
Browse files
Options
Downloads
Patches
Plain Diff
Adding output file functionality closing
#14
parent
88b72325
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Gifitti/Gifitti/Form1.Designer.cs
+74
-8
74 additions, 8 deletions
src/Gifitti/Gifitti/Form1.Designer.cs
src/Gifitti/Gifitti/Form1.cs
+124
-0
124 additions, 0 deletions
src/Gifitti/Gifitti/Form1.cs
src/Gifitti/Gifitti/Form1.resx
+3
-0
3 additions, 0 deletions
src/Gifitti/Gifitti/Form1.resx
with
201 additions
and
8 deletions
src/Gifitti/Gifitti/Form1.Designer.cs
+
74
−
8
View file @
2dea6af3
...
...
@@ -28,20 +28,29 @@
/// </summary>
private
void
InitializeComponent
()
{
this
.
components
=
new
System
.
ComponentModel
.
Container
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button2
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
openFileDialog1
=
new
System
.
Windows
.
Forms
.
OpenFileDialog
();
this
.
folderBrowserDialog1
=
new
System
.
Windows
.
Forms
.
FolderBrowserDialog
();
this
.
gifView
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
mainMenu1
=
new
System
.
Windows
.
Forms
.
MainMenu
(
this
.
components
);
this
.
menuItem1
=
new
System
.
Windows
.
Forms
.
MenuItem
();
this
.
menuItem2
=
new
System
.
Windows
.
Forms
.
MenuItem
();
this
.
JPEG
=
new
System
.
Windows
.
Forms
.
MenuItem
();
this
.
PNG
=
new
System
.
Windows
.
Forms
.
MenuItem
();
this
.
BMP
=
new
System
.
Windows
.
Forms
.
MenuItem
();
this
.
TIFF
=
new
System
.
Windows
.
Forms
.
MenuItem
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
gifView
)).
BeginInit
();
this
.
SuspendLayout
();
//
// button1
//
this
.
button1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
506
);
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
411
);
this
.
button1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
1
39
,
35
);
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
1
04
,
28
);
this
.
button1
.
TabIndex
=
0
;
this
.
button1
.
Text
=
"Open GIF"
;
this
.
button1
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -50,9 +59,10 @@
// button2
//
this
.
button2
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
431
,
506
);
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
323
,
411
);
this
.
button2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
button2
.
Name
=
"button2"
;
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
1
39
,
35
);
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
1
04
,
28
);
this
.
button2
.
TabIndex
=
1
;
this
.
button2
.
Text
=
"Save GIF"
;
this
.
button2
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -64,20 +74,69 @@
//
// gifView
//
this
.
gifView
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
12
);
this
.
gifView
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
10
);
this
.
gifView
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
gifView
.
Name
=
"gifView"
;
this
.
gifView
.
Size
=
new
System
.
Drawing
.
Size
(
55
8
,
488
);
this
.
gifView
.
Size
=
new
System
.
Drawing
.
Size
(
41
8
,
396
);
this
.
gifView
.
TabIndex
=
2
;
this
.
gifView
.
TabStop
=
false
;
//
// mainMenu1
//
this
.
mainMenu1
.
MenuItems
.
AddRange
(
new
System
.
Windows
.
Forms
.
MenuItem
[]
{
this
.
menuItem1
});
//
// menuItem1
//
this
.
menuItem1
.
Index
=
0
;
this
.
menuItem1
.
MenuItems
.
AddRange
(
new
System
.
Windows
.
Forms
.
MenuItem
[]
{
this
.
menuItem2
});
this
.
menuItem1
.
Text
=
"File"
;
//
// menuItem2
//
this
.
menuItem2
.
Index
=
0
;
this
.
menuItem2
.
MenuItems
.
AddRange
(
new
System
.
Windows
.
Forms
.
MenuItem
[]
{
this
.
JPEG
,
this
.
PNG
,
this
.
BMP
,
this
.
TIFF
});
this
.
menuItem2
.
Text
=
"Output As Image"
;
//
// JPEG
//
this
.
JPEG
.
Index
=
0
;
this
.
JPEG
.
Text
=
"JPEG"
;
this
.
JPEG
.
Click
+=
new
System
.
EventHandler
(
this
.
menuItem3_Click
);
//
// PNG
//
this
.
PNG
.
Index
=
1
;
this
.
PNG
.
Text
=
"PNG"
;
this
.
PNG
.
Click
+=
new
System
.
EventHandler
(
this
.
menuItem4_Click
);
//
// BMP
//
this
.
BMP
.
Index
=
2
;
this
.
BMP
.
Text
=
"BMP"
;
this
.
BMP
.
Click
+=
new
System
.
EventHandler
(
this
.
menuItem5_Click
);
//
// TIFF
//
this
.
TIFF
.
Index
=
3
;
this
.
TIFF
.
Text
=
"TIFF"
;
this
.
TIFF
.
Click
+=
new
System
.
EventHandler
(
this
.
menuItem6_Click
);
//
// Form1
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
8
F
,
1
6
F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6
F
,
1
3
F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
582
,
553
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
436
,
449
);
this
.
Controls
.
Add
(
this
.
gifView
);
this
.
Controls
.
Add
(
this
.
button2
);
this
.
Controls
.
Add
(
this
.
button1
);
this
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
Menu
=
this
.
mainMenu1
;
this
.
Name
=
"Form1"
;
this
.
StartPosition
=
System
.
Windows
.
Forms
.
FormStartPosition
.
CenterScreen
;
this
.
Text
=
"Form1"
;
...
...
@@ -94,6 +153,13 @@
private
System
.
Windows
.
Forms
.
OpenFileDialog
openFileDialog1
;
private
System
.
Windows
.
Forms
.
FolderBrowserDialog
folderBrowserDialog1
;
private
System
.
Windows
.
Forms
.
PictureBox
gifView
;
private
System
.
Windows
.
Forms
.
MainMenu
mainMenu1
;
private
System
.
Windows
.
Forms
.
MenuItem
menuItem1
;
private
System
.
Windows
.
Forms
.
MenuItem
menuItem2
;
private
System
.
Windows
.
Forms
.
MenuItem
JPEG
;
private
System
.
Windows
.
Forms
.
MenuItem
PNG
;
private
System
.
Windows
.
Forms
.
MenuItem
BMP
;
private
System
.
Windows
.
Forms
.
MenuItem
TIFF
;
}
}
This diff is collapsed.
Click to expand it.
src/Gifitti/Gifitti/Form1.cs
+
124
−
0
View file @
2dea6af3
...
...
@@ -87,5 +87,129 @@ namespace Gifitti
}
}
private
Boolean
chkImage
()
{
Boolean
check
=
true
;
try
{
int
Length
=
globalGif
.
GetFrameCount
(
FrameDimension
.
Time
);
}
catch
(
Exception
e
)
{
check
=
false
;
MessageBox
.
Show
(
"Must load a gif before getting output"
);
}
return
(
check
);
}
private
void
menuItem3_Click
(
object
sender
,
EventArgs
e
)
{
if
(
chkImage
())
{
String
x
=
""
;
if
(
folderBrowserDialog1
.
ShowDialog
()
==
DialogResult
.
OK
)
{
x
=
folderBrowserDialog1
.
SelectedPath
;
}
List
<
Image
>
IMGs
=
new
List
<
Image
>();
Image
test
;
int
Length
=
globalGif
.
GetFrameCount
(
FrameDimension
.
Time
);
if
(
x
!=
""
)
{
for
(
int
i
=
0
;
i
<
Length
;
i
++)
{
globalGif
.
SelectActiveFrame
(
FrameDimension
.
Time
,
i
);
test
=
globalGif
;
String
y
=
"\\tmpj-"
+
i
+
".jpg"
;
String
xy
=
x
+
y
;
test
.
Save
(
@xy
,
ImageFormat
.
Jpeg
);
}
}
}
}
private
void
menuItem4_Click
(
object
sender
,
EventArgs
e
)
{
if
(
chkImage
())
{
String
x
=
""
;
if
(
folderBrowserDialog1
.
ShowDialog
()
==
DialogResult
.
OK
)
{
x
=
folderBrowserDialog1
.
SelectedPath
;
}
List
<
Image
>
IMGs
=
new
List
<
Image
>();
Image
test
;
int
Length
=
globalGif
.
GetFrameCount
(
FrameDimension
.
Time
);
if
(
x
!=
""
)
{
for
(
int
i
=
0
;
i
<
Length
;
i
++)
{
globalGif
.
SelectActiveFrame
(
FrameDimension
.
Time
,
i
);
test
=
globalGif
;
String
y
=
"\\tmpp-"
+
i
+
".png"
;
String
xy
=
x
+
y
;
test
.
Save
(
@xy
,
ImageFormat
.
Png
);
}
}
}
}
private
void
menuItem5_Click
(
object
sender
,
EventArgs
e
)
{
if
(
chkImage
())
{
String
x
=
""
;
if
(
folderBrowserDialog1
.
ShowDialog
()
==
DialogResult
.
OK
)
{
x
=
folderBrowserDialog1
.
SelectedPath
;
}
List
<
Image
>
IMGs
=
new
List
<
Image
>();
Image
test
;
int
Length
=
globalGif
.
GetFrameCount
(
FrameDimension
.
Time
);
if
(
x
!=
""
)
{
for
(
int
i
=
0
;
i
<
Length
;
i
++)
{
globalGif
.
SelectActiveFrame
(
FrameDimension
.
Time
,
i
);
test
=
new
Bitmap
(
globalGif
);
String
y
=
"\\tmpb-"
+
i
+
".bmp"
;
String
xy
=
x
+
y
;
test
.
Save
(
@xy
);
}
}
}
}
private
void
menuItem6_Click
(
object
sender
,
EventArgs
e
)
{
if
(
chkImage
())
{
String
x
=
""
;
if
(
folderBrowserDialog1
.
ShowDialog
()
==
DialogResult
.
OK
)
{
x
=
folderBrowserDialog1
.
SelectedPath
;
}
List
<
Image
>
IMGs
=
new
List
<
Image
>();
Image
test
;
int
Length
=
globalGif
.
GetFrameCount
(
FrameDimension
.
Time
);
if
(
x
!=
""
)
{
for
(
int
i
=
0
;
i
<
Length
;
i
++)
{
globalGif
.
SelectActiveFrame
(
FrameDimension
.
Time
,
i
);
test
=
globalGif
;
String
y
=
"\\tmpt-"
+
i
+
".tiff"
;
String
xy
=
x
+
y
;
test
.
Save
(
@xy
,
ImageFormat
.
Tiff
);
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
src/Gifitti/Gifitti/Form1.resx
+
3
−
0
View file @
2dea6af3
...
...
@@ -123,4 +123,7 @@
<metadata
name=
"folderBrowserDialog1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
184, 17
</value>
</metadata>
<metadata
name=
"mainMenu1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
353, 17
</value>
</metadata>
</root>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment