Pictures


#1

Hi Alexey!

Please see (file: ftp://dm.co.kg/ppt/Kaman_Investor.zip) slides 5, 10 and 15 - the pie charts are coming over very large.
On slide 10 it actually covers some of the words.

On slide 12 - the red logo between "Industrial Production" and Capacity
Utilization" is almost covered up and the "n" on Utilization is missing.

On slide 22 the numbers in the 3rd column are not exactly lined up with the
other lines in columns 1, 2 and 4.


#2

http://dm.co.kg/ppt/Kaman_Investor.zip


#3

Can you please sort it out as soon as possible, as this issue is very important for us.


#4

After my tests:

1. Pie charts have correct size.

2. Slide 12. red logon and text are part of metafile so text and chart can’t be drawn separately.
Try to draw it with standard Graphics.DrawImage method and you will have the same result.

3. Slide 22. Columns are ok in my case but text has wrong space between lines.
Also several slides have wrong text size and style. It will be fixed.


#5
  1. Pie charts have correct size.

    Please save the picture with PowerPoint from attached ppt file and try this code:

    System.Drawing.Image pic = pres.Pictures.GetPictureById(pf.PictureId).Image;
    pic.Save(“E:\123.jpg”, ImageFormat.Jpeg);

    to save same picture. Then compare both - 123.jpg and PowerPoint’s picture.

    Chart of picture 123.jpg has coordinates 0,0 and size of the picture, but chart or the picture saved in PowerPoint has quite a different coordinates and size. (ыse the attached file with pictures).
    The pie chart is enlarged when drawn, but at your thumbnails it looks very nice, what can be the problem?


#6

See the attachment (in thumbnail it looks good).


#7

See the attachment


#8

I thought you have wrong picture size on thumbnail.
That is part of code for drawing metafiles:

System.Drawing.SizeF size = new System.Drawing.SizeF(0, 0);
size.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
size.Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;

System.Drawing.Bitmap bmp = new System.Drawing.Bitmap((int)(size.Width), (int)(size.Height), gr);
System.Drawing.Graphics tgr = System.Drawing.Graphics.FromImage(bmp);

System.Drawing.GraphicsUnit gu = System.Drawing.GraphicsUnit.Pixel;
System.Drawing.RectangleF bounds = picture.GetBounds(ref gu);

System.Drawing.Imaging.MetafileHeader mh = ((System.Drawing.Imaging.Metafile)picture).GetMetafileHeader();

tgr.DrawImage(picture, bounds,
new System.Drawing.RectangleF(bounds.X, bounds.Y, (float)picture.Width, (float)picture.Height),
System.Drawing.GraphicsUnit.Pixel);
tgr.Dispose();

x = (float)bmp.Width * ((float)CropLeft / 100f);
y = (float)bmp.Height * ((float)CropTop / 100f);
width = (float)bmp.Width - (float)bmp.Width * ((float)CropRight / 100f) - x;
height = (float)bmp.Height - (float)bmp.Height * ((float)CropBottom / 100f) - y;

gr.DrawImage(bmp, new System.Drawing.RectangleF(X, Y, Width, Height),
new System.Drawing.RectangleF(x, y, width, height),
System.Drawing.GraphicsUnit.Pixel);

bmp.Dispose();


#9

Hi Alexey!

For

3. Slide 22. Columns are ok in my case but text has wrong space between lines.
Also several slides have wrong text size and style. It will be fixed.

when do you think it can be done? I need this fix as soon as possible.

Thanks,

Alex


#10

Space between lines already fixed.
We are testing it now.


#11

Thanks for code.

Now my code is:

System.Drawing.GraphicsUnit gu = System.Drawing.GraphicsUnit.Pixel;
System.Drawing.RectangleF bounds = pic.GetBounds(ref gu);
bm = new Bitmap(width, height, g);
System.Drawing.Graphics tgr = System.Drawing.Graphics.FromImage(bm);
tgr.DrawImage(pic, new System.Drawing.RectangleF(0, 0, width, height),
new System.Drawing.RectangleF(0, 0,
(float)bounds.Right, (float)bounds.Bottom),System.Drawing.GraphicsUnit.Pixel);
tgr.Dispose();

(width, height - PictureFrame width and height)

(see attachment, two files are metafiles)
pic.GetBounds for 1st picture returns: X = 0, Y = 0, Width = 721.0, Height = 428.0
Right = 721.0, Bottom = 428.0
but for 2nd picture returns: X = 120.0, Y = 160.0, Width = 823.0, Height = 695.0
Right = 943.0, Bottom = 855.0 (943.0-823.0 = 120, 855.0 - 695.0 = 160.0)
Draws: 1st - very nice, 2nd - bad.

What can be the problem?


#12

see the attachment with ppt file.


#13

Probably because you didn’t check metafile header and screen resolution.