Skip to content

Commit

Permalink
イメージビューア仮実装
Browse files Browse the repository at this point in the history
  • Loading branch information
ggslyman committed Mar 21, 2014
1 parent 63ac377 commit b399d56
Show file tree
Hide file tree
Showing 14 changed files with 237 additions and 100 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@

##更新履歴

* 14/03/10 2.0.1 Rev.6
- https、ttpsでもリンクをはる様に修正
- イメージビューアを仮実装

* 14/03/10 2.0.1 Rev.5
- レス新着音の鳴るタイミングが新規レス取得時になっていたのをレス読み上げ前に修正

Expand Down
52 changes: 0 additions & 52 deletions SpeechCast/Controls/TabPageImg.Designer.cs

This file was deleted.

25 changes: 0 additions & 25 deletions SpeechCast/Controls/TabPageImg.cs

This file was deleted.

8 changes: 6 additions & 2 deletions SpeechCast/FormCaption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ public static void DrawCaption(Graphics g, Rectangle captionRect, string caption
System.Drawing.Font font = captionFont.CreateFont();

StringFormat stringFormat = new StringFormat();

//TextFormatFlags txtFormatFlags = new TextFormatFlags();
//txtFormatFlags = TextFormatFlags.Top | TextFormatFlags.Left;
if (captionFont.IsDirectionVertical)
{
stringFormat.FormatFlags = StringFormatFlags.DirectionVertical | StringFormatFlags.DirectionRightToLeft;
}

List<Point> offsets = new List<Point>();

for (int i = 0; i < captionFont.BorderSize; i++)
Expand All @@ -229,20 +229,24 @@ public static void DrawCaption(Graphics g, Rectangle captionRect, string caption

if (isAAMode)
{
//TextRenderer.DrawText(g, captionText, font, borderRect, FormMain.UserConfig.AACaptionFont.Colors.BorderColor, txtFormatFlags);
g.DrawString(captionText, font, captionFont.BorderBrush, borderRect.X, borderRect.Y);
}
else
{
//TextRenderer.DrawText(g, captionText, font, borderRect, FormMain.UserConfig.CaptionFont.Colors.BorderColor, txtFormatFlags);
g.DrawString(captionText, font, captionFont.BorderBrush, borderRect, stringFormat);
}
}

if (isAAMode)
{
//TextRenderer.DrawText(g, captionText, font, captionRect, FormMain.UserConfig.AACaptionFont.Colors.HighForeColor, txtFormatFlags);
g.DrawString(captionText, font, captionFont.GetForeBrush(captionRect), captionRect.X, captionRect.Y);
}
else
{
//TextRenderer.DrawText(g, captionText, font, captionRect, FormMain.UserConfig.CaptionFont.Colors.HighForeColor, txtFormatFlags);
g.DrawString(captionText, font, captionFont.GetForeBrush(captionRect), captionRect, stringFormat);
}
}
Expand Down
15 changes: 14 additions & 1 deletion SpeechCast/FormMain.Designer.cs

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

36 changes: 32 additions & 4 deletions SpeechCast/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ void webBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
webBrowser.Document.Window.ScrollTo(0, GetResponsesScrollY(resNo));
}
}
else if (url.EndsWith("jpg") || url.EndsWith("png") || url.EndsWith("gif"))
{
e.Cancel = true;
oepnFormViewNewtab(url);
}
else if (url.StartsWith("http:"))
{
System.Diagnostics.Process.Start(url);
Expand Down Expand Up @@ -912,8 +917,6 @@ private void StartSpeaking(int resNumber)
private void StartSpeaking()
{
speakClipboard = false;
isSpeaking = true;


if (CurrentResNumber <= 0)
{
Expand All @@ -937,6 +940,7 @@ private void StartSpeaking()
}

isSpeakingWarningMessage = false;
isSpeaking = true;
StartSpeaking(text);
listViewResponses.Items[CurrentResNumber - 1].Selected = true;
webBrowser.Document.Window.ScrollTo(0, GetResponsesScrollY(CurrentResNumber));
Expand All @@ -950,6 +954,7 @@ private void StartSpeaking()
isSpeakingWarningMessage = true;
FormCaption.Instance.IsAAMode = false;
synthesizer.Rate = UserConfig.SpeakingRate;
isSpeaking = true;
synthesizer.SpeakAsync(speakingText);
}
else if (CurrentResNumber > Response.MaxResponseCount && openNextThread == ReadThread)
Expand All @@ -960,11 +965,12 @@ private void StartSpeaking()
isSpeakingWarningMessage = true;
FormCaption.Instance.IsAAMode = false;
synthesizer.Rate = UserConfig.SpeakingRate;
isSpeaking = true;
synthesizer.SpeakAsync(speakingText);
}
else
{
speakingCompletedTime = System.DateTime.Now;
if(isSpeaking)speakingCompletedTime = System.DateTime.Now;
isSpeaking = false;
}
}
Expand Down Expand Up @@ -2091,6 +2097,28 @@ private static string MatchKanaEvaluator(System.Text.RegularExpressions.Match m)
{
return Microsoft.VisualBasic.Strings.StrConv(m.Value, Microsoft.VisualBasic.VbStrConv.Wide, 0);
}
}

private void toolStripButton19_Click(object sender, EventArgs e)
{
oepnFormViewNewtab("http://peercasket.s3.amazonaws.com/2014s/title/d348fc17-c842-412f-bfe4-37af265905cd");
}

// イメージビューア起動
public FormViewResource formViewResource = null;
private void oepnFormViewNewtab(string url)
{
if ((formViewResource == null) || formViewResource.IsDisposed)
{
formViewResource = new FormViewResource(UserConfig.FormViewToRect);
formViewResource.Show();
}
formViewResource.addTab(url);
formViewResource.Activate();
}
// ビューア位置の保存
public void saveViewerPos(FormViewResource frm)
{
UserConfig.SetFormToRect(ref UserConfig.FormViewToRect, frm);
}
}
}
15 changes: 15 additions & 0 deletions SpeechCast/FormMain.resx
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,21 @@
jMTxYRvTjOk+2jqSAKiHQ1yAIOEQBwBVNEg4xAH4db3zEncKgkFIFmEQCAkArA7hAqCKcq53ahA2gNlq
3DumCoQBcPc5B6Lve3z9BIC7Q+YJAo8hPIqOtp+apnk8ZK4g1MIhlPJ381Y2hGq4RIDAM/AcHkUvkW8v
aUqIfs4AAAAASUVORK5CYII=
</value>
</data>
<data name="toolStripButton19.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolStripButtonThreads.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
Expand Down
63 changes: 63 additions & 0 deletions SpeechCast/FormViewResource.Designer.cs

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

Loading

0 comments on commit b399d56

Please sign in to comment.