Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
A Pictures Puzzle
I have some thumbnails (all .jpgs) which I am trying to insert into rows in
a spreadsheet. All are reported by Windows Explorer to have a Width of 60 pixels and a Height of 100 pixels. Using various programs all look to be exactly or nearly exactly the same size. But when I insert these pictures into a spreadsheet only one of them is the size I think it should be - i.e. the size all of these pictures appear to be when rendered by various programs - all of the others are shrunk to about 1/5th to 1/4th the size they appear to be when rendered by various programs.. After a lot of experimentation I think that the problem might relate to "resolution". The one picture which ends up the "right" size when inserted is 72x72dpi. Most of the other pictures are 300x300, one is 180x180. Note that all of the shrunk pictures appear to be the same size - i.e. the 180x180 picture appears to be the same size as the 300x300 pictures. First question: does it sound like I am on the right track? If so, second question: what's the best solution. I know I can size the pictures, but I am creating this spreadsheet programmatically using VB.Net. So, first problem, it looks like I have to figure out how Excel names inserted pictures. (Using record macro the first line of the macro is ActiveSheet.Shapes("Picture 7").Select. Ok, I was probably playing with the 7th or maybe 8th inserted picture. BUT ... will future versions of Excel name pictures in EXACTLY the same way?) But using VB.Net I also have the option of invoking some program which can change resolution. Maybe, there's a lot of mystery to all of this pictures stuff. And I sure don't know off-hand of any programs which can adjust resolution. But, if I do go with changing the size in Excel, and I expect I will, which is better - to change the "size" height and width, or the "scale" height and width. Both seem to achieve the desired result. But maybe one method retains more fidelity than the other. I don't see any difference but I know that my eyes are not the best. Thanks for reading all this. I'll be grateful for any advice and/or sympathy. Bob |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
A Pictures Puzzle
The naming convention for pictures STINKs in Excel. The name property cannot
be changed. Excel assigns a name to the picture when it is inserted. Haven't found a way to change the name. I ussually find the name by using the following loop for each myshape in worksheets.shapes msgbox(myshape.name) next myshape "eBob.com" wrote: I have some thumbnails (all .jpgs) which I am trying to insert into rows in a spreadsheet. All are reported by Windows Explorer to have a Width of 60 pixels and a Height of 100 pixels. Using various programs all look to be exactly or nearly exactly the same size. But when I insert these pictures into a spreadsheet only one of them is the size I think it should be - i.e. the size all of these pictures appear to be when rendered by various programs - all of the others are shrunk to about 1/5th to 1/4th the size they appear to be when rendered by various programs.. After a lot of experimentation I think that the problem might relate to "resolution". The one picture which ends up the "right" size when inserted is 72x72dpi. Most of the other pictures are 300x300, one is 180x180. Note that all of the shrunk pictures appear to be the same size - i.e. the 180x180 picture appears to be the same size as the 300x300 pictures. First question: does it sound like I am on the right track? If so, second question: what's the best solution. I know I can size the pictures, but I am creating this spreadsheet programmatically using VB.Net. So, first problem, it looks like I have to figure out how Excel names inserted pictures. (Using record macro the first line of the macro is ActiveSheet.Shapes("Picture 7").Select. Ok, I was probably playing with the 7th or maybe 8th inserted picture. BUT ... will future versions of Excel name pictures in EXACTLY the same way?) But using VB.Net I also have the option of invoking some program which can change resolution. Maybe, there's a lot of mystery to all of this pictures stuff. And I sure don't know off-hand of any programs which can adjust resolution. But, if I do go with changing the size in Excel, and I expect I will, which is better - to change the "size" height and width, or the "scale" height and width. Both seem to achieve the desired result. But maybe one method retains more fidelity than the other. I don't see any difference but I know that my eyes are not the best. Thanks for reading all this. I'll be grateful for any advice and/or sympathy. Bob |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
A Pictures Puzzle
"Shapes" is a collection. If you first determine the number of shapes on a sheet... N = ActiveSheet.Shapes.Count, then the next picture you add will be ActiveSheet.Shapes(N + 1). I doubt if users will take kindly to your program changing the screen resolution for them You could however, determine the existing screen resolution and size the picture accordingly. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "eBob.com" wrote in message I have some thumbnails (all .jpgs) which I am trying to insert into rows in a spreadsheet. All are reported by Windows Explorer to have a Width of 60 pixels and a Height of 100 pixels. Using various programs all look to be exactly or nearly exactly the same size. But when I insert these pictures into a spreadsheet only one of them is the size I think it should be - i.e. the size all of these pictures appear to be when rendered by various programs - all of the others are shrunk to about 1/5th to 1/4th the size they appear to be when rendered by various programs.. After a lot of experimentation I think that the problem might relate to "resolution". The one picture which ends up the "right" size when inserted is 72x72dpi. Most of the other pictures are 300x300, one is 180x180. Note that all of the shrunk pictures appear to be the same size - i.e. the 180x180 picture appears to be the same size as the 300x300 pictures. First question: does it sound like I am on the right track? If so, second question: what's the best solution. I know I can size the pictures, but I am creating this spreadsheet programmatically using VB.Net. So, first problem, it looks like I have to figure out how Excel names inserted pictures. (Using record macro the first line of the macro is ActiveSheet.Shapes("Picture 7").Select. Ok, I was probably playing with the 7th or maybe 8th inserted picture. BUT ... will future versions of Excel name pictures in EXACTLY the same way?) But using VB.Net I also have the option of invoking some program which can change resolution. Maybe, there's a lot of mystery to all of this pictures stuff. And I sure don't know off-hand of any programs which can adjust resolution. But, if I do go with changing the size in Excel, and I expect I will, which is better - to change the "size" height and width, or the "scale" height and width. Both seem to achieve the desired result. But maybe one method retains more fidelity than the other. I don't see any difference but I know that my eyes are not the best. Thanks for reading all this. I'll be grateful for any advice and/or sympathy. Bob |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
A Pictures Puzzle
As Jim says, the object counter and name suffix increments each time a shape
is added to the sheet. However if shapes are deleted the counter is not decremented or reset to the lowest non existent object number. The only way to reset the counter is to delete all shapes and save / close / reopen the workbook. To return the name of the last added shape, or in your case last inserted picture, the name would be - with activesheet.shapes if .count then sName = .item(.count).name end if end with (above assumes ZOrder has not been changed since the last shape was added) Concerning size, the Insert method does not accurately set the size to the original picture size. It sounds like you already know your image sizes so simply resize width & height after the insert. Your image sizes are in pixels so bear in mind 'Shapes' are sized in Points. For most systems 0.75 pixels = 1 point, but best to verify. You may then want to add say 1.5 points for the border. If you don't know your original image sizes, generally WxH can be read from file or after first loading to a Worksheet Image control. Regards, Peter T "eBob.com" wrote in message ... I have some thumbnails (all .jpgs) which I am trying to insert into rows in a spreadsheet. All are reported by Windows Explorer to have a Width of 60 pixels and a Height of 100 pixels. Using various programs all look to be exactly or nearly exactly the same size. But when I insert these pictures into a spreadsheet only one of them is the size I think it should be - i.e. the size all of these pictures appear to be when rendered by various programs - all of the others are shrunk to about 1/5th to 1/4th the size they appear to be when rendered by various programs.. After a lot of experimentation I think that the problem might relate to "resolution". The one picture which ends up the "right" size when inserted is 72x72dpi. Most of the other pictures are 300x300, one is 180x180. Note that all of the shrunk pictures appear to be the same size - i.e. the 180x180 picture appears to be the same size as the 300x300 pictures. First question: does it sound like I am on the right track? If so, second question: what's the best solution. I know I can size the pictures, but I am creating this spreadsheet programmatically using VB.Net. So, first problem, it looks like I have to figure out how Excel names inserted pictures. (Using record macro the first line of the macro is ActiveSheet.Shapes("Picture 7").Select. Ok, I was probably playing with the 7th or maybe 8th inserted picture. BUT ... will future versions of Excel name pictures in EXACTLY the same way?) But using VB.Net I also have the option of invoking some program which can change resolution. Maybe, there's a lot of mystery to all of this pictures stuff. And I sure don't know off-hand of any programs which can adjust resolution. But, if I do go with changing the size in Excel, and I expect I will, which is better - to change the "size" height and width, or the "scale" height and width. Both seem to achieve the desired result. But maybe one method retains more fidelity than the other. I don't see any difference but I know that my eyes are not the best. Thanks for reading all this. I'll be grateful for any advice and/or sympathy. Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do you export pictures from my pictures file into a word docu | New Users to Excel | |||
Storing Clip Art pictures in My Pictures folder | Excel Discussion (Misc queries) | |||
Pictures.Visible question (after adding many pictures, they stop disappearing) | Excel Programming | |||
Excel's Compress Pictures or deleting pictures doesn't seem work | Excel Discussion (Misc queries) | |||
Can you help!!!!! New Puzzle | Excel Discussion (Misc queries) |