2015年11月16日 星期一

[遊戲] 瘋狂賽車 - 超越極速




瘋狂賽車又來了...
這是一個沒有速度極限的賽車遊戲。

隨著速度越來越快,你將需要更快的反應。
如果你喜歡這種瘋狂的速度感,本遊戲會讓你感到興奮。

請記住,盡可能收集硬幣,越多越好。
這些金幣可以換成續關鑰匙。

[遊戲] 瘋狂直昇機 - 城市戰爭





這一次,你的直昇機已裝上武器...

你有機關槍可以用極為強大的速度射出子彈,
只要你適時的補充,這些子彈是打不完的。

你有飛彈可以用來擊落轟炸機,或用來消滅地上的坦克車,
當然,你也可以用飛彈來清除任何擋在你前面的障礙物。

還有一個所謂的無敵模式,
在這模式下,你是不受任何敵方的武器所攻擊,也可穿越任何的障礙物..

讓我們一起來戰鬥吧,盡情享受殺敵的快感.....

[Game] Crazy Helicopter - City War





This time, your helicopter is armed.

You have machine gun to shoot the bullets in powerful speed.
The bullets will not run out of as long as you refill them in time.

You have missiles to shoot down the bomber or to destroy the tank.
Of course, you can also use missiles to clear any obstacles in front of you.

When you are in super mode, you are invincible and have endless bullets and missiles.
Let's fight together......

2015年7月28日 星期二

[C#] Android, iOS App icon generator

When we develop Android or iOS App, we need to design the icon the our App as well.
The annoying problem is that we need to have different resolutions of icons.

There have many free website which can help to us to do that.
However, some websites need to have account to start generating.
Some websites may have slow response time.

So...I decide to write a program using C# for such purpose.
At the same time, I think that there may have many people have similar requirement like me.
I would like to share my program as below:

I suggest that you can design a icon with the resolution of 1024x1024.
That you can open it with generateAppIcon and generate files with different resolutions you need.


By the way, we often use rounded corner in our icon.
In Android, you can design your rounded corner.
The system will show the icon as you design.

However, in iOS, the system will generate the rounded corner itself.
The radius of rounded corner may change for different system version.
I would like to suggest that you can design a icon without rounded corner and let the system to generate the rounded corner itself.

[C#] Android, iOS App icon產生器

當我們開發Android,iOS的App時,需要製作App的icon,
比較麻煩是,我們需要不同解析度的icon,
網路上有許多免費的網站可以幫忙產生不同的解析度,
不過,有的網站需要申請帳號,
有的網站處理速度很慢,

所以,只好自己用C#寫一個來用,
我想可能很多人都有這樣的需求,
所以就分享出來,
下載網址如下:

建議先製作一個1024x1024大小的icon,
然後丟到generateAppIcon去產生不同的解析度,
Launch Images是app還沒開始前會先載入的畫面,
很多人會放公司的logo之類的,
它的大小最大是1242x2208, 1536x2048等等,
最好是製作一個高解析的圖當成原圖,

附帶一提,
很多App icon都會有圓角的設計,
Android,你可以設計自己想要的圓角,
它會按照你產生的icon來顯示,

iOS,系統會自己截取你的icon來產生圓角,
而且它的圓角也可能因為不同版本會改變,
除非你的icon和圓角半徑有關,
不然,建議你可以產生一個沒有圓角的icon,
讓系統自己來產生圓角

[C#] When we use PictureBox to load the picture file,the picture file will be locked?

We often use PictureBox to load the picture file, like below:
try
{
 var srcImage = Image.FromFile("test.jpg");
 myPictureBox.Image = srcImage;
}
catch (System.OutOfMemoryException)
{
 MessageBox.Show("Invalid picture format.");
}
However, you will find that you cannot move or rename this picture file.
That is this picture file is locked.

What if we wish that it will not be locked?
We can solve this problem be using FileStream, as below:
try
{
 FileStream stream = new FileStream(openFileDialog1.FileName, FileMode.Open);
 var srcImage = Image.FromStream(stream);
 stream.Close();
 myPictureBox.Image = srcImage;
}
catch (System.ArgumentException)
{
 MessageBox.Show("Invalid picture format.");
}

[C#] 圖片檔案載入PictureBox 控制項時,影像檔案會被鎖住?

我們常常會利用PictureBox來載入影像檔案,
例如以下的用法:
try
{
 var srcImage = Image.FromFile("test.jpg");
 myPictureBox.Image = srcImage;
}
catch (System.OutOfMemoryException)
{
 MessageBox.Show("Invalid picture format.");
}
不過,你會發現此時你無法再對這個做移動或者更名等動作,
因為這個檔案已經被鎖住了,

如果我們不希望它被鎖住呢?
我們可以藉用FileStream來解決,如下:
try
{
 FileStream stream = new FileStream(openFileDialog1.FileName, FileMode.Open);
 var srcImage = Image.FromStream(stream);
 stream.Close();
 myPictureBox.Image = srcImage;
}
catch (System.ArgumentException)
{
 MessageBox.Show("Invalid picture format.");
}