そして、今年の2月に奄美大島に行った際に使った空港も表示されています。
出発の時に使った空港はGoogle先生的には「ハニーダ空港」と言うらしいです。
やっぱ外人さんですもんね。
でも、その前の宮崎からの帰りには東京国際空港ってなってるんですよねー。
連絡先データの読み取り: Android アプリケーションがユーザの連絡先リストにアクセスできるようにすることで、ノートをメールする際にメールアドレスが自動補完されるようにします。ユーザの連絡先リスト全体が Evernote サービスと共有される訳ではありません。この情報は、メールを送信する場合にのみ使用されます。(http://jp.support.evernote.com/link/portal/16051/16073/Article/1307/Android)
StreamResourceInfo source = Application.GetResourceStream(new Uri("/Images/Category/Image01.png", UriKind.Relative));
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(source.Stream);
WriteableBitmap wb = new WriteableBitmap(bitmap);
これで実行しても、StreamResourceInfoはnullになってしまいます。StreamResourceInfo source = Application.GetResourceStream(new Uri("Images/Category/Image01.png", UriKind.Relative));
画像パスの指定で先頭のスラッシュを消しました。NavigationService.Navigate(new Uri("/next.xaml", UriKind.Relative));
NavigationService.GoBack();
NavigationService.Navigate(new Uri("/next.xaml?param=value", UriKind.Relative));
NavigationContext.QueryString.TryGetValue("param", out value);
IsolatedStorageSettings appstore = IsolatedStorageSettings.ApplicationSettings; appstore["key"] = value;受け取る側:
IsolatedStorageSettings appstore = IsolatedStorageSettings.ApplicationSettings; String value = Convert.toString(appstore["key"]);
public class exButton extends LibButton {
public exButton(Context context, AttributeSet attrs)
{
super(context, attrs);
}
}
<com.feelg.android.androidLib.exButton android:id="@+id/exButton01" android:layout_width="fill_parent" android:layout_height="wrap_content" />
static public function Encrypt($value){
//Base64でエンコードする
$encodedValue = base64_encode($value);
/* 暗号モジュールをオープンします */
$td = self::getCryptModule();
/* データを暗号化します */
$encrypted = mcrypt_generic($td, $encodedValue);
//暗号化された文字をBase64でエンコードする
$encodedEncryptValue = base64_encode($encrypted);
/* 暗号化ハンドラを終了します */
mcrypt_generic_deinit($td);
/* モジュールを閉じます */
mcrypt_module_close($td);
return $encodedEncryptValue;
}
static public function Decrypt($value){
//Base64デコードする
$decodedValue = base64_decode($value);
/* 暗号モジュールをオープンします */
$td = self::getCryptModule();
/* 暗号化された文字列を復号します */
$decrypted = mdecrypt_generic($td, $decodedValue);
/* 復号ハンドルを終了し、モジュールを閉じます */
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
//Base64デコードする
$decodedDecryptValue = base64_decode($decrypted);
return $decodedDecryptValue;
}
static private function getCryptModule()
{
/* 暗号モジュールをオープンします */
//$td = mcrypt_module_open('tripledes', '', MCRYPT_MODE_ECB, '');
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_ECB, '');
/* IV を作成し、キー長を定義します。Windows では、かわりに
* MCRYPT_RAND を使用します */
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
$ks = mcrypt_enc_get_key_size($td);
/* キーを作成します */
$key = substr(md5('very secret key'), 0, $ks);
/* 復号用の暗号モジュールを初期化します */
mcrypt_generic_init($td, $key, $iv);
return $td;
}
private void drawString(FileInfo copiedfi,string s,Font font)
{
int quality = 85;
//一時ファイルの作成
string tmpFilename = copiedfi.FullName + ".tmp";
FileInfo tmpFi = copiedfi.CopyTo(tmpFilename, true);
//Bitmapオブジェクトの生成
using (Bitmap bmp = new Bitmap(tmpFi.FullName))
{
//解像度の設定
bmp.SetResolution(72, 72);
//Graphicsオブジェクトを取得
using (Graphics g = Graphics.FromImage(bmp))
{
//画像を描画する
g.DrawImage(bmp, 0, 0, bmp.Width, bmp.Height);
//白のブラシを作成する
using( Brush b = new SolidBrush(System.Drawing.Color.White))
{
//文字の領域サイズを取得する
StringFormat sf = new StringFormat();
SizeF stringSize = g.MeasureString(s, font, bmp.Width, sf);
//文字を描画する
g.DrawString(s, font, b, (bmp.Width / 2) - (stringSize.Width / 2), (bmp.Height / 2) - (stringSize.Height / 2));
}
}
//品質を指定
System.Drawing.Imaging.EncoderParameters eps = new System.Drawing.Imaging.EncoderParameters(1);
eps.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, quality);
//エンコーダーを取得する
System.Drawing.Imaging.ImageCodecInfo ici = this.getEncoderInfo("image/jpeg");
bmp.Save(copiedfi.FullName, ici, eps);
}
//一時ファイルの削除
if( File.Exists(tmpFilename) )File.Delete(tmpFilename);
}
//MimeTypeで指定されたImageCodecInfoを探して返す
private System.Drawing.Imaging.ImageCodecInfo getEncoderInfo(string mineType)
{
//GDI+ に組み込まれたイメージ エンコーダに関する情報をすべて取得
System.Drawing.Imaging.ImageCodecInfo[] encs = System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders();
//指定されたMimeTypeを探して見つかれば返す
foreach (System.Drawing.Imaging.ImageCodecInfo enc in encs)
if (enc.MimeType == mineType)
return enc;
return null;
}