Skip to content

Commit

Permalink
2019年7月10日
Browse files Browse the repository at this point in the history
  • Loading branch information
nayaku committed Jul 10, 2019
1 parent 69204e3 commit 60c5684
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ImageManager/Form/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,6 @@ private void ImagePanel_SizeChanged(object sender, EventArgs e)
/// <summary>
/// 图片加载完成调用
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void LoadImageFinish(string path, Image image)
{
//测试
Expand Down
47 changes: 47 additions & 0 deletions ImageManager/Form/StickerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ public partial class StickerForm : Form
/// 图片路径(如果从从文件中读取图片的话)
/// </summary>
private string _imagePath = null;
/// <summary>
/// 旋转的角度
/// </summary>
private int _rotateAngle = 0;
/// <summary>
/// 是否水平翻转
/// </summary>
private bool _isFlipX = false;
/// <summary>
/// 是否垂直翻转
/// </summary>
private bool _isFlipY = false;


public StickerForm(string imgPath) : this(ImageReaderFactory.GetInstance().CreateImageReader(imgPath).Read(imgPath))
Expand Down Expand Up @@ -190,6 +202,34 @@ private void ZoomImage()
pictureBox.Image = SuperImageReader.ZoomImage((Image)_sourceImage.Clone(), _zoomRate);
Size = pictureBox.Size = pictureBox.Image.Size;
if (oldImage != _sourceImage) oldImage.Dispose();
// 对之前的旋转和翻转处理
if (_isFlipX && _isFlipY)
{
RotateImage(RotateFlipType.RotateNoneFlipXY);
if (_rotateAngle == 180) _rotateAngle = 0;
}
else if (_isFlipX)
{
RotateImage(RotateFlipType.RotateNoneFlipX);
}
else if (_isFlipY)
{
RotateImage(RotateFlipType.RotateNoneFlipY);
}

if (_rotateAngle == 90)
{
RotateImage(RotateFlipType.Rotate90FlipNone);
}
else if (_rotateAngle == 180)
{
RotateImage(RotateFlipType.Rotate180FlipNone);
}
else if (_rotateAngle == 270)
{
RotateImage(RotateFlipType.Rotate270FlipNone);
}

}

}
Expand Down Expand Up @@ -284,27 +324,34 @@ private void ZoomToCustomerSetSizeToolStripMenuItem_Click(object sender, EventAr

private void Rotate90FilpToolStripMenuItem_Click(object sender, EventArgs e)
{
_rotateAngle = (_rotateAngle + 90) % 360;
RotateImage(RotateFlipType.Rotate90FlipNone);

}

private void Rotate180FlipToolStripMenuItem_Click(object sender, EventArgs e)
{
_rotateAngle = (_rotateAngle + 180) % 360;
RotateImage(RotateFlipType.Rotate180FlipNone);
}

private void Rotate270FlipToolStripMenuItem_Click(object sender, EventArgs e)
{
_rotateAngle = (_rotateAngle + 270) % 360;
RotateImage(RotateFlipType.Rotate270FlipNone);
}

private void VerticalFlipToolStripMenuItem_Click(object sender, EventArgs e)
{
_rotateAngle = (_rotateAngle + 180) % 360;
_isFlipY = !_isFlipY;
RotateImage(RotateFlipType.RotateNoneFlipY);
}

private void HorizontalFilpToolStripMenuItem_Click(object sender, EventArgs e)
{
_rotateAngle = (360 - _rotateAngle) % 360;
_isFlipX = !_isFlipX;
RotateImage(RotateFlipType.RotateNoneFlipX);
}

Expand Down
Binary file added ImageManager/NDP471-KB4033344-Web.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@

## 更新

### 2019年7月10日更新

- 修复了缩放图片以后,旋转和翻转失效问题。<small>(这里应该有个公式解决这个问题,可惜我不会,只能采用枚举一个个尝试解决)</small>
- <font color="red">【未解决】</font> 在某种情况下,不缩放直接翻转和旋转图片可能会弹出“GDI+ 中发生一般性错误。”。暂且不知道原因和解决方法。



### 2019年7月1日更新

- 修复对某个图片删除修改后再添加,出现缓存不更新的BUG。
Expand Down
Binary file modified 打包程序/Output/素材管理器安装程序.exe
Binary file not shown.
1 change: 1 addition & 0 deletions 打包程序/script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks:
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\NDP471-KB4033344-Web.exe";
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
Expand Down

0 comments on commit 60c5684

Please sign in to comment.