What are the right properties to reach this specific result? [closed]

asked 2014-09-22 23:14:57 +0200

Renon gravatar image

Hello, i am trying to export an image with the following properties:

                PropertyValue filterProps[] = new PropertyValue[8];

                filterProps[0] = new PropertyValue();
                filterProps[0].Name = "PixelWidth";
                filterProps[0].Value = new Integer(640);

                filterProps[1] = new PropertyValue();
                filterProps[1].Name = "PixelHeight";
                filterProps[1].Value = new Integer(480);

                filterProps[2] = new PropertyValue();
                filterProps[2].Name = "Color";
                filterProps[2].Value = new Integer(6);

                filterProps[3] = new PropertyValue();
                filterProps[3].Name = "ExportMode";
                filterProps[3].Value = new Integer(2);

                filterProps[4] = new PropertyValue();
                filterProps[4].Name = "Resolution";
                filterProps[4].Value = new Integer(72);

                filterProps[5] = new PropertyValue();
                filterProps[5].Name = "RLE_Coding";
                filterProps[5].Value = new Boolean(false);

                filterProps[6] = new PropertyValue();
                filterProps[6].Name = "LogicalWidth";
                filterProps[6].Value = new Integer(16930);

                filterProps[7] = new PropertyValue();
                filterProps[7].Name = "LogicalHeight";
                filterProps[7].Value = new Integer(12694);

                PropertyValue aProps[] = new PropertyValue[3];

                aProps[0] = new PropertyValue();
                aProps[0].Name = "MediaType";
                aProps[0].Value = "image/x-MS-bmp";

                aProps[1] = new PropertyValue();
                aProps[1].Name = "URL";
                aProps[1].Value = "file:///" + oURL[0].Path.substring(1) + nomePagina + ".bmp";

                aProps[2] = new PropertyValue();
                aProps[2].Name = "FilterData";
                aProps[2].Value = filterProps;

The result that i need to reach is: Dimensions :640x480 pixels, color depth: 8 bits color, Resolution: 72 ppi, no compression.

After i set ExportMode = 2, i changed LogicalWidth and LogicalHeight to a specific value to reach the needed size: 640x480p. I tried to set it in PixelHeight and PixelWidth but after to export the size increased (No idea why).

Resolution and COmpression apparently work well.

But now, the big problem is to relate MediaType property to Color property. If i set "image/x-MS-bmp" as MediaType, it allows me to change Color properties with no problem but! there will be a color deformation in the image objects after beign exported, that's something i dont want.

To solve it, i set the MediaType value to "image/bmp" but now i cant change the color properties. The image seems to be exported as 24 bits color, how can i change it?.

How can i reach that result?

Sorry if i didnt express myself clearly. Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2016-03-03 22:35:01.638828