Select to view content in your preferred language

Problem with Legend Swatches

3558
7
04-06-2011 05:56 AM
CiprianLazar
Deactivated User
Hi all!
I have a custom application built in ArcGIS Mobile 10. I am trying to build a legend for the map. On my emulator and on some devices, the swatches look good, but on a type of device (running windows mobile 6.5), the swatches appear to be black & white. On the map, the symbols are drawn as they should, but in the legend they appear as you can see in the attachment "bad_swatches.jpg". Both the emulator and the "problem" device have the same screen size (480x640 16bps) and the same operating system (Windows Mobile 6.5).
Here is a piece of C# code use to draw the swatches:
Size size = layer.Renderer.GetRecommendedSwatchSize();
                        if (size.Height < 25)
                            size = new Size(25, 25);
                        IList<LegendSwatch> legendList = layer.Renderer.GetLegendSwatches(panelLegenda.BackColor, size.Width, size.Height);
if (legendList != null)
                        {
                            //...............
                            foreach (LegendSwatch legendSwatch in legendList)
                            {
                                //** Draw each swatch used in current layer along with its name
                                PictureBox picture = new PictureBox();
                                picture.Size =  size; 
                                picture.Image = legendSwatch.Image;
                                picture.Location = new Point(45, vPositioning);
                                panelLegenda.Controls.Add(picture);
                                //...............
                            }
                        }


I tried changing the BackColor of the swatches. I tried using AntiAliasing (4th parameter in GetLegendSwatches). I tried changing the swatch size. I tried changing the theme of the Windows Moobile device. None of these solved my problem.
I don't know what to change anymore in order to solve this problem.
0 Kudos
7 Replies
by Anonymous User
Not applicable
Original User: tesla007

It has a 8bit preview look to it.
0 Kudos
CiprianLazar
Deactivated User
I double checked the device in Start -> Settings -> System -> System Info -> Display and it clearly states that it has 65536 colors and 16 BitsPerPixel. How can I be sure that my app is running in 16 bpp?

I've put a PictureBox control on top of my Map control and I've set its Image property at the application start using the code below
private void Test()
        {
            DataSource ds = map1.DataSources[0];
            Layer layer = ((MobileCache)ds).Layers[0];
            IList<LegendSwatch> legendList = layer.Renderer.GetLegendSwatches(Color.Yellow, 50, 50);
            LegendSwatch legendSwatch = legendList[0];
            pictureBoxTest.Image = legendSwatch.Image;
        }

As you can see in the attachment, the symbol is drawn as it should on the map, but not in my pictureBox control.
Why is this happening?
0 Kudos
by Anonymous User
Not applicable
Original User: theoldjam

I've tested this on a couple of 6.5 devices and I can't reproduce it.  Does this happen with an out of the box application?  Also- is it only specific to this project, or all projects on this device?
0 Kudos
CiprianLazar
Deactivated User
I am using a custom application. However, I just tested the out of the box application and still the problem persists (when I use identify or collect, not on the map viewer). I used a new project using the mobile cache from the Mobile Walkthrough (10.0) (http://www.arcgis.com/home/item.html?id=e5cebabbd52d46498f3cc6540e17ef18).

The problem only appears on Motorola MC65 9B devices (i tested on 3 of these devices and they all have this problem). On other devices that I tested, the swatches were drawn as they should.
0 Kudos
by Anonymous User
Not applicable
Original User: Denise62

Are you running the latest software updates for the MC65? Visiting Motorola Support site, I came across several updates that may or may not resolve this issue, but we would definitely want to rule out everything we can.

MC65, WinMo 6.5 OS, OEM 1.20.01 or 1.21.00
http://support.symbol.com/support/

Esri Support did test on Motorola MC55, WinMo 6.1 OS unit but was unable to reproduce reported behavior. We do not have any MC65 devices to perform testing but would be happy to troubleshoot should someone be willing to provide the unit for testing purposes. Please submit your support request via Esri Support site.

Cheers,
Denise
0 Kudos
CiprianLazar
Deactivated User
Hi Denise!
As you suggested, I've updated the software for the MC65. I've upgraded from OEM 01.20.0000 to 01.21.0000, then to 01.21.0103 and then to 01.20.0001. The issue was there in all the versions. Even if the OS comes with .NET Compact Framework, I've also reinstalled the .NET Compact Framework 2.0 SP2 on the device, but to no avail. Nothing has changed.
If you please, tell me what would be the procedure to send one MC65 device to Esri for testing purposes. I am located in Romania. Also, I have to check with my boss if she lets me send the device to you. The device belongs to the company that I work for.

Best regards.
0 Kudos
by Anonymous User
Not applicable
Original User: Denise62

Hi,

As you are in Romania, please contact the local Esri International Distributor, Esri Romania SRL and have them submit a support incident with Esri Support. We can then connect you with ArcGIS Mobile support analyst who will work directly with you to troubleshoot this further. We can arrange delivery of the test device with the support analyst once you have approval to provide a test unit. I will work with support and ArcGIS Mobile team after reproducible case is identified.

ESRI Romania S.R.L.
Str. Roma nr. 8, ap. 1, Sector 1
011774 Bucharest
Romania
Email: esri@esriro.ro
Phone: (+40) 21-231 14 22
Phone: (+40) 21-230 73 81
Web: http://www.esriro.ro

Thank you,
Denise
0 Kudos