2015年7月31日 星期五

Infocus M511 Root 初體驗[半教學] - part1

上個周末回家用我的 ASUS zenfone5 跟老媽交換了 InfocusM511

1G RAM 用起來覺得會頓,不知道是不是被2G的zenfone5給慣壞了XD


於是乎就起了想ROOT的念頭,也是悲劇的開始...


心想好歹我也刷過

htc sensation xe
sony xperia arc s
asus zenfone5

應該不至於太難,趁著下班前找了一下相關資料,嗯...好少XD


不管是01、Android台灣中文網或是其他手機論壇都沒什麼資料

最後找到了這個連結:

http://yanicat0306.tumblr.com/post/110700661290/infocus-m510-root-%E6%96%B9%E6%B3%95

馬的  剛剛才發現這是M510的...


-----------------------------------------------------------

好的 今天來補上後續

我點進連結看了一下,發現步驟還滿簡單的


二話不說,趕緊下載他提供的檔案包


裡面分別是 tool跟 SuperSU的壓縮檔


tool解開後裡面是 adb、fastboot工具以及一個recovery 的 img


而superSU.zip 就是superSU.zip,他不用解壓縮XD


依照步驟,將superSU.zip放進我的microSD


接著使用他寫好的批次檔,批次檔在做的事情就是下列三個動作


1.用adb下指令進入fastboot mode

2.用fastboot 把recovery 刷進手機裡
3.進入recovery模式


接著插入我的microSD >> 選擇從SD 卡安裝>>選取superSU.zip>>安裝

噠噠噠噠噠......

ERROR!Signature Verification Failed


WTF 這什麼鬼 


這時可不能慌 哼 說不定只是安裝失敗 reboot就好了


reboot sytem......









靠么 左上角是什麼

讓我們放大來看


厄.....

它是寫 The boot.img verification fail, boot.img have been tramper.

簡單來說就是boot.img 不能用(汗

就這樣他不停  reboot again....

儘管心裡很慌忙,但還是要保持冷靜

趕緊打開電腦版LINE,傳給女友

我手機刷機 開不了機...

以免她以為我一直不讀不回 電話還關機

接著開始google,字還沒打完就出現完整的關鍵字


哈哈,果然也有人跟我一樣的問題


有FB粉絲團也有XDA論壇,肯定有希望







點進FB粉絲團後,他說...









































崩潰...

再點XDA 論壇進去看

fastboot oem unlock

似乎又出現了希望 

說不定是infocus 的 boot 有官方鎖鎖住

然後看了一下時間,該下班了,回家後再來try

----------------------------------------------
今天先寫到這吧

明天一早要騎腳踏車 來睡了

明天再補上 M511 簡單的刷機步驟

:D

2014年12月23日 星期二

Joomla

YA 網站架好了

要準備換到這個網站囉

joomla整個都還沒摸熟

暫時先這樣  搞好久XD


http://martin1850.yabi.me/joomla30/

2014年3月14日 星期五

[C#] Bitmap 大小縮放

下午在做報表功能時,發現某一塊資訊顯示區域太大,一半就這麼消失了...

google了一下,找到了這篇[C#] 影像檔大小縮放,發現它完全達到跟我所需要的功能

所以拿了這兩個Function來用

程式碼:

 public static Bitmap Resize(Bitmap originImage, Double times)
        {
            int width = Convert.ToInt32(originImage.Width * times);
            int height = Convert.ToInt32(originImage.Height * times);

            return Process(originImage, originImage.Width, originImage.Height, width, height);
        }

        private static Bitmap Process(Bitmap originImage, int oriwidth, int oriheight, int width, int height)
        {
            Bitmap resizedbitmap = new Bitmap(width, height);
            Graphics g = Graphics.FromImage(resizedbitmap);
            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            g.Clear(Color.Transparent);
            g.DrawImage(originImage, new Rectangle(0, 0, width, height), new Rectangle(0, 0, oriwidth, oriheight), GraphicsUnit.Pixel);
            return resizedbitmap;
        }


資料來源:愛流浪的小風-[C#] 影像檔大小縮放

2014年3月8日 星期六

[C#]-程式介面控制項依據解析度調整大小

目前電腦解析度 : 1280 X 1024
Form設定為最大化,單純看Form裏頭控制項的變化

程式介面:
程式碼:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 解析度
{
    public partial class Form1 : Form
    {
        float sel_w = 0, sel_h = 0;
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                foreach (Control c in panel1.Controls)
                {
                    c.Scale(sel_w / 1024, sel_h / 768);
                    Single currentSize = c.Font.Size * (sel_h / 768);
                    c.Font = new Font("微軟正黑體", currentSize);
                }
                sel_w = 1024;
                sel_h = 768;
            }
            else
            {
                foreach (Control c in panel1.Controls)
                {
                    c.Scale(sel_w / 1280, sel_h / 1024);
                    Single currentSize = c.Font.Size * (sel_h / 1024);
                    c.Font = new Font("微軟正黑體", currentSize);

                }
                sel_w = 1280;
                sel_h = 1024;
            }
            label1.Text = "button1.Width:" + button1.Width + "\nbutton1.Height:" + button1.Height + "\nbutton1.Top:" + button1.Top + "\nbutton1.Left:" + button1.Left;
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            radioButton1.Checked = true;
            sel_w = Screen.PrimaryScreen.Bounds.Width;
            sel_h = Screen.PrimaryScreen.Bounds.Height;
        }    
    }
}
程式結果:



程式應該可以再修改,只是先達到功能來測試,完成,哈哈。











2012年5月24日 星期四

[Blogger]在Blogger中插入程式碼

終於在GOOGL強大的搜尋之下,將網誌裡分享的程式碼在文章中插入了 : )


syntaxhighlighter的官方網站


原本以為會顯示Flash的copy與顯示原始碼的功能,可是卻只有一個問號

但後來在syntaxhighlighter網站看到這段才知道原因



儘管沒有複製原始碼的功能,但只要在程式畫面中點兩下,就會自動全選該程式碼,還挺方便的。


目前在syntaxhighlighter的官方網站並沒有支援VHDL的語言,但是在網路上有人寫出
Syntax Highlighter 3 VHDL Brush ,這樣VHDL的程式碼也成功顯示了。


本來想整理一下,也寫一篇來分享一下如何在Blogger中插入程式碼
但想想,覺得好懶喔XD


[ANDROID]SurfaceHolder.Callback方法練習


SurfaceView_test2Activity.java

package bear.Graphis.surfaceView_test2;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class SurfaceView_test2Activity extends Activity {



    class MysurfaceView extends SurfaceView implements SurfaceHolder.Callback{

     public MysurfaceView(Context context) {
      super(context);
      // TODO Auto-generated constructor stub
      getHolder().addCallback(this);
     }
 
   

     public void surfaceCreated(SurfaceHolder holder) {//當Surface第一次創建後會立即執行該函數,盡量別在這邊畫
     
      Canvas canvas =holder.lockCanvas();//加鎖
      Resources res=getResources();//取得資源檔
      BitmapDrawable bmpDrwable = (BitmapDrawable) res.getDrawable(R.drawable.icon);//構造一個BitmapDrawable
      Bitmap bmp = bmpDrwable.getBitmap();//取得BitmapDrawable內的圖片
      Paint mypaint =new Paint();
      //設定Paint屬性
      mypaint.setColor(Color.GREEN);
      mypaint.setTextSize(40);
     
      //設定Canvas屬性
      canvas.drawColor(Color.WHITE);
      canvas.drawText("SurfaceView.Callback", 0, 40, mypaint);//顯示字
      canvas.drawBitmap(bmp, 0, 100, mypaint);//顯示圖片
      holder.unlockCanvasAndPost(canvas);//解鎖
     }



     public void surfaceChanged(SurfaceHolder holder, int format, int width,
       int height) {
      //當Surface的狀態(大小和格式)發生變化的時候會調用該函数
     
     }

     public void surfaceDestroyed(SurfaceHolder holder) {
      // Surface被摧毁前會调用该函数,該函数被调用後就不能繼续使用Surface了,一般在該函数中來清理使用的資源
     
     }
   
     }


    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new MysurfaceView(this));//將創建的MysurfaceView設定成顯示畫面
   
    }

} 



main.xml


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

</LinearLayout>




結果: