Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 341265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:41:36+00:00 2026-05-12T10:41:36+00:00

I’m new mobile development and i’m working on an proof of concept application on

  • 0

I’m new mobile development and i’m working on an proof of concept application on Windows Mobile 6.0 Os and CF 2.0

I tried to design new backgorund for my application with the Adobe Photoshop, i found a tutorial on the codeproject.com about solving the windows mobile fullscreen problem and app image background issue with Pinvoke api according to Dr.Luiji’s iPhone UI in Windows Mobile article

When i tried to add form background some gradient image.
alt text http://img268.imageshack.us/img268/8482/ppc2.jpg

Image quality seems poor. But i tried to add another background image to my form background, it seems good.

alt text http://img199.imageshack.us/img199/9812/ppc3.jpg

I don’t understand where is the problem, i tried to change my backgorund image to bmp, png, jpg etc. it still poor. What am i doing mistake with photoshop ?
(Note : on the other hand, i haven’t tried this design on real pocketpc yet. is it not ?)

However,
My another real problem is OnPaintBackground method on the mobile forms.
as i wrote above i have used Pinvoke api for drawing fullscreen forms. Here is the sample code :

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);

        }

    }
}

I’m trying to add some controls on the form then controls are shown transparent when the application run the first time. If you try to move cursor over the these controls, these are turn to normally.

What can i do for solve this problem ?

Thank you.

alt text http://img508.imageshack.us/img508/6717/ppc1.jpg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:41:36+00:00Added an answer on May 12, 2026 at 10:41 am

    First of all, your code needs some clean up:

    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();
    
            Bitmap backgroundVertical = null;
            public MainForm()
            {
                InitializeComponent();
                backgroundVertical = new Bitmap(_globals.ApplicationPath + @"\Resources\wallpaper.bmp");
            }
    
            private void MainForm_Load(object sender, EventArgs e)
            {
            }
    
    
            protected override void OnPaintBackground(PaintEventArgs e)
            {
                //base.OnPaintBackground(e);
            }
    
    
            protected override void OnPaint(PaintEventArgs e)
            {
                 using (Bitmap buffer = new Bitmap(this.Width, this.Height))
                 using (Graphics gfx = Graphics.FromImage(buffer))
                 {
                    gfx.Clear(this.BackColor);
                    gfx.DrawImage(backgroundVertical, 0, 0);
                    //this.Invalidate();  Don't call Invalidate here, it shouldn't be needed
                    e.Graphics.DrawImage(buffer, 0, 0);
                 }
            }
        }
    }
    

    Chris Tacke’s classic blog talks about Bitmaps in the CF. You need to be careful:

    http://blog.opennetcf.com/ctacke/PermaLink,guid,987041fc-2e13-4bab-930a-f79021225b74.aspx

    After all that, I’m not really sure what your question is. Could you be more specific? Like for example, I don’t see any P/Invokes, but you said you used some. Where are they?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.