Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andanteyk committed Jun 25, 2017
2 parents df61bf5 + 4a555d0 commit 2470267
Show file tree
Hide file tree
Showing 88 changed files with 7,657 additions and 3,890 deletions.
16 changes: 13 additions & 3 deletions Browser/FormBrowser.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions Browser/FormBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ private static HtmlElement getFrameElementById( HtmlDocument document, String id
/// </summary>
/// <param name="path">保存先。</param>
/// <param name="format">画像のフォーマット。</param>
private void SaveScreenShot( string path, System.Drawing.Imaging.ImageFormat format ) {
private void SaveScreenShot( string path, ImageFormat format ) {

var wb = Browser;

Expand Down Expand Up @@ -541,7 +541,10 @@ private void SaveScreenShot( string path, System.Drawing.Imaging.ImageFormat for
if ( viewobj != null ) {
var rect = new RECT { left = 0, top = 0, width = KanColleSize.Width, height = KanColleSize.Height };

using ( var image = new Bitmap( rect.width, rect.height, System.Drawing.Imaging.PixelFormat.Format24bppRgb ) ) {
bool is32bpp = format == ImageFormat.Png && Configuration.AvoidTwitterDeterioration;

// twitter の劣化回避を行う場合は32ビットの色深度で作業する
using ( var image = new Bitmap( rect.width, rect.height, is32bpp ? PixelFormat.Format32bppArgb : PixelFormat.Format24bppRgb ) ) {

var device = new DVTARGETDEVICE { tdSize = 0 };

Expand All @@ -551,6 +554,13 @@ private void SaveScreenShot( string path, System.Drawing.Imaging.ImageFormat for
g.ReleaseHdc( hdc );
}

if ( is32bpp ) {
// 不透明ピクセルのみだと jpeg 化されてしまうため、1px だけわずかに透明にする
Color temp = image.GetPixel( image.Width - 1, image.Height - 1 );
image.SetPixel( image.Width - 1, image.Height - 1, Color.FromArgb( 252, temp.R, temp.G, temp.B ) );
}


image.Save( path, format );
}

Expand Down Expand Up @@ -1034,6 +1044,20 @@ private void ToolMenu_Other_LastScreenShot_OpenScreenShotFolder_Click( object se
System.Diagnostics.Process.Start( Configuration.ScreenShotPath );
}

private void ToolMenu_Other_LastScreenShot_CopyToClipboard_Click( object sender, EventArgs e ) {

if ( _lastScreenShotPath != null && System.IO.File.Exists( _lastScreenShotPath ) ) {
try {
using ( var img = new Bitmap( _lastScreenShotPath ) ) {
Clipboard.SetImage( img );
}
} catch ( Exception ex ) {
BrowserHost.AsyncRemoteRun( () =>
BrowserHost.Proxy.SendErrorReport( ex.ToString(), "スクリーンショットのクリップボードへのコピーに失敗しました。" ) );
}
}
}



protected override void WndProc( ref Message m ) {
Expand Down Expand Up @@ -1167,6 +1191,7 @@ public static extern bool DeleteUrlCacheEntry(

#endregion


}


Expand Down
6 changes: 6 additions & 0 deletions BrowserLib/IBrowserHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ public class BrowserConfiguration {
[DataMember]
public bool IsDMMreloadDialogDestroyable { get; set; }

/// <summary>
/// Twitter の画像圧縮を回避するか
/// </summary>
[DataMember]
public bool AvoidTwitterDeterioration { get; set; }

/// <summary>
/// ツールメニューの配置
/// </summary>
Expand Down
Binary file modified ElectronicObserver/Assets.zip
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2470267

Please sign in to comment.