PDA

View Full Version : Image rendering in forms



QuinRiva
07-07-2008, 01:26 AM
Say I have a picture that also has writing in it, if I resize this picture I want the writing to still be legible. Excel 2007 does this quite effectively, I'm not sure what image rendering/smoothing/anti-aliasing techniques it uses, but the text on the image is still easy to read.

However, when I place an image in a form, and resize it (stretch to fit), no post-processing image rendering is done, and it is nigh impossible to read the text in the image. Is it possible to force Excel to render images in forms in the same rendering engine for images in forms that it uses for images in sheets? Is there anyway to get the images to render in a way that will make the text legible?

Oh, and please don't suggest that I save a copy of the image at a lower resolution, I am dealing with hundreds of images so that isn't feasible.

lifeson
07-07-2008, 02:36 AM
Are all the images the same dimensions (w x h)?

QuinRiva
07-07-2008, 08:59 AM
Yep they are all the same height/width.

lifeson
07-07-2008, 10:14 AM
Have you tried using frmPictureSizeModeClip and sizing the image holder so it is big enough to hold the image without compression?

QuinRiva
07-08-2008, 10:01 PM
No, I need to compress the image. Currently each image is 480x680, and I have multiple images in each form. I have found that 50% h/w scaling is an acceptable compromise between quality and size (i.e. 240x340). This works well in Excel, but in the forms it renders poorly.

Also, I have noticed that pictures sized in the forms seem to be weird sizes. I was under the impression that the .height and .width properties were dimensions in pixels, however when I set a width of 240, they are displayed as a width of 320 pixels which is out by exactly 1/3.

For instance, 6 images at a width of 240 fit exactly the width of my screen (1920), but 1920/6 = 320. Any ideas what's going on here?

QuinRiva
07-09-2008, 02:49 AM
I appear to have found a solution that I might be able to implement:

http://www.aboutmydot.net/code/thumbnails.vb.txt

However, most of this is beyond my level of understanding, and as far as I can tell the conversion back to jpg is done as part of the "save" command. I'm aware that this can be saved to the system.IO.stream instead of saving it to an actual file, but I'd rather keep my feet out of the murky IO stream.

Because of the large number of files I'm dealing with, I don't think it would be very memory efficient to leave them in .bmp format. Does anyone know how I could modify this to "return a jpg" rather than save it to a file?