DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 1 Aug 2007 09:12:01 -0700,    posted on: microsoft.public.dotnet.framework.compactframework        back       

Thread Index
  1    David am
          2    David am


DrawImage problem in WM6   
The code below is supposed to load an image from a GIF file, and draw it with 
transparency. It works fine my WM5 devices, but on the WM6 device I'm 
currently using, the image is drawn without transparency (i.e., with a purple 
background).

protected override void OnPaint(PaintEventArgs e)
{
    Bitmap bmp = new System.Drawing.Bitmap("\\Windows\\ques.gif");
    if (bmp != null)
    {
        Color clr = bmp.GetPixel(0, 0);
        ImageAttr attr = new ImageAttributes();
        attr.SetColorKey(clr, clr);

       e.Graphics.DrawImage(bmp, mRect,
           0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, attr);
    }
}

I uploaded a copy of the GIF file, and set its transparency using PhotoShop. 
If I use that version, it draws correctly, but that's not an option (my 
production code actually gets the GIF file name from the registry).

It may be relevant that my code targets NETCF 1, which is not installed on 
the WM6 device.

Any clues, or suggestions for a workaround, would be greatly appreciated.

--
David
Date:Wed, 1 Aug 2007 09:12:01 -0700   Author:  

RE: DrawImage problem in WM6   

> 
> It may be relevant that my code targets NETCF 1, which is not installed on 
> the WM6 device.


I built a test CF1 application with the above code, and it exhibited the 
problem. I then upgraded it to CF2, and the problem went away.

Can anyone shed any light on why an application targeting CF1 would 
misbehave in this way?

--
David
Date:Wed, 1 Aug 2007 10:50:02 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us