Skip to content

Commit fa7fc60

Browse files
committed
Better Selection tool integration
1 parent 5fd7664 commit fa7fc60

26 files changed

+61
-70
lines changed

.vs/quick-picture-viewer/v16/.suo

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

quick-picture-viewer/AboutForm.Designer.cs

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quick-picture-viewer/MainForm.cs

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,14 +827,42 @@ public void setCheckboardBackground(bool b, bool saveToDisk)
827827

828828
private void flipVerticalButton_Click(object sender, EventArgs e)
829829
{
830-
originalImage.RotateFlip(RotateFlipType.RotateNoneFlipX);
830+
if (selForm != null)
831+
{
832+
Rectangle r = GetSelectionRect();
833+
Bitmap cropped = originalImage.Clone(r, originalImage.PixelFormat);
834+
cropped.RotateFlip(RotateFlipType.RotateNoneFlipX);
835+
using (Graphics g = Graphics.FromImage(originalImage))
836+
{
837+
g.DrawImage(cropped, r);
838+
}
839+
selectionBtn.Checked = false;
840+
}
841+
else
842+
{
843+
originalImage.RotateFlip(RotateFlipType.RotateNoneFlipX);
844+
}
831845
pictureBox.Image = originalImage;
832846
setImageChanged(true);
833847
}
834848

835849
private void flipHorizontalButton_Click(object sender, EventArgs e)
836850
{
837-
originalImage.RotateFlip(RotateFlipType.RotateNoneFlipY);
851+
if (selForm != null)
852+
{
853+
Rectangle r = GetSelectionRect();
854+
Bitmap cropped = originalImage.Clone(r, originalImage.PixelFormat);
855+
cropped.RotateFlip(RotateFlipType.RotateNoneFlipY);
856+
using (Graphics g = Graphics.FromImage(originalImage))
857+
{
858+
g.DrawImage(cropped, r);
859+
}
860+
selectionBtn.Checked = false;
861+
}
862+
else
863+
{
864+
originalImage.RotateFlip(RotateFlipType.RotateNoneFlipY);
865+
}
838866
pictureBox.Image = originalImage;
839867
setImageChanged(true);
840868
}
@@ -1935,7 +1963,21 @@ public void NewWindow()
19351963

19361964
private void rotate180Button_Click(object sender, EventArgs e)
19371965
{
1938-
originalImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
1966+
if (selForm != null)
1967+
{
1968+
Rectangle r = GetSelectionRect();
1969+
Bitmap cropped = originalImage.Clone(r, originalImage.PixelFormat);
1970+
cropped.RotateFlip(RotateFlipType.Rotate180FlipNone);
1971+
using (Graphics g = Graphics.FromImage(originalImage))
1972+
{
1973+
g.DrawImage(cropped, r);
1974+
}
1975+
selectionBtn.Checked = false;
1976+
}
1977+
else
1978+
{
1979+
originalImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
1980+
}
19391981
pictureBox.Image = originalImage;
19401982
setImageChanged(true);
19411983
}

quick-picture-viewer/bin/Debug/languages/lang_en.resx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,6 @@
557557
<value>Open folder recursively</value>
558558
<comment>Menu</comment>
559559
</data>
560-
<data name="open-windows-settings" xml:space="preserve">
561-
<value>Open Windows settings</value>
562-
<comment>About</comment>
563-
</data>
564560
<data name="open-with" xml:space="preserve">
565561
<value>Open with</value>
566562
<comment>Menu</comment>

quick-picture-viewer/bin/Debug/languages/lang_fr.resx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
<comment>Picture in picture</comment>
199199
</data>
200200
<data name="check-for-app-updates" xml:space="preserve">
201-
<value>Rechercher les mises à jour automatiquement</value>
201+
<value>Rechercher les mises à jour</value>
202202
<comment>Settings</comment>
203203
</data>
204204
<data name="checkboard-background" xml:space="preserve">
@@ -557,10 +557,6 @@
557557
<value>Ouvrir le dossier de manière récursive</value>
558558
<comment>Menu</comment>
559559
</data>
560-
<data name="open-windows-settings" xml:space="preserve">
561-
<value>Ouvrir les paramètres de Windows</value>
562-
<comment>About</comment>
563-
</data>
564560
<data name="open-with" xml:space="preserve">
565561
<value>Ouvrir avec</value>
566562
<comment>Menu</comment>

quick-picture-viewer/bin/Debug/languages/lang_hu.resx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,6 @@
558558
<value>Rekurzívan nyissa meg a mappát</value>
559559
<comment>Menu</comment>
560560
</data>
561-
<data name="open-windows-settings" xml:space="preserve">
562-
<value>Windows beállítások megnyitása</value>
563-
<comment>About</comment>
564-
</data>
565561
<data name="open-with" xml:space="preserve">
566562
<value>Társítás</value>
567563
<comment>Menu</comment>
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)