Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you export pictures from my pictures file into a word docu Becky New Users to Excel 1 November 20th 09 07:02 PM
Storing Clip Art pictures in My Pictures folder jfg Excel Discussion (Misc queries) 4 August 10th 07 06:12 AM
Pictures.Visible question (after adding many pictures, they stop disappearing) Abe[_4_] Excel Programming 2 July 11th 06 05:02 AM
Excel's Compress Pictures or deleting pictures doesn't seem work guidod Excel Discussion (Misc queries) 1 January 29th 06 06:51 AM
Can you help!!!!! New Puzzle Krefty Excel Discussion (Misc queries) 0 June 13th 05 08:13 PM


All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"