私は新しいモバイル開発者で、Windows Mobile 6.0 Os および CF 2.0 の概念実証アプリケーションに取り組んでいます。
Adobe Photoshop を使用してアプリケーション用の新しいバックゴーランドを設計しようとしましたが、Dr.Luiji のWindows Mobile の iPhone UI の記事に従って、Pinvoke API を使用して Windows モバイルのフルスクリーンの問題とアプリの画像の背景の問題を解決する方法についてのチュートリアルを codeproject.com で見つけました。
フォームの背景にグラデーション画像を追加しようとしたとき。 代替テキスト http://img268.imageshack.us/img268/8482/ppc2.jpg
画質が悪いようです。しかし、フォームの背景に別の背景画像を追加しようとしましたが、良さそうです。
代替テキスト http://img199.imageshack.us/img199/9812/ppc3.jpg
どこに問題があるのか わかりません。バックゴーンドの画像をbmp、png、jpgなどに変更しようとしましたが、まだ貧弱です。私はフォトショップで何を間違えていますか?
(注: 一方で、このデザインはまだ実際の PocketPC で試していません。そうではありませんか?)
ただし、私のもう 1 つの本当の問題は、モバイル フォームの OnPaintBackground メソッドです。上で書いたように、フルスクリーン フォームの描画に Pinvoke API を使用しました。サンプルコードは次のとおりです。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using Microsoft.WindowsMobile.Status;
namespace My_Mobile
{
public partial class MainForm : Form
{
Globals _globals = new Globals();
Graphics _gxBuffer;
Bitmap _offsetBitmap;
Bitmap backgroundVertical = null;
public MainForm()
{
InitializeComponent();
backgroundVertical = new Bitmap(_globals.ApplicationPath + @"\Resources\wallpaper.bmp");
_offsetBitmap = new Bitmap(this.Width, this.Height);
}
private void MainForm_Load(object sender, EventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//base.OnPaintBackground(e);
}
protected override void OnPaint(PaintEventArgs e)
{
_gxBuffer = Graphics.FromImage(_offsetBitmap);
_gxBuffer.Clear(this.BackColor);
_gxBuffer.DrawImage(backgroundVertical, 0, 0);
this.Invalidate();
e.Graphics.DrawImage(_offsetBitmap, 0, 0);
}
}
}
フォームにいくつかのコントロールを追加しようとしていますが、アプリケーションが初めて実行されたときにコントロールが透明に表示されます。これらのコントロールの上にカーソルを移動しようとすると、これらは正常に変わります。
この問題を解決するにはどうすればよいですか?
ありがとうございました。