How to read from the ShapeSheet how many pixels the original image has

Started by Visisthebest, October 27, 2021, 11:34:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

Looking at the properties of an Image dropped on a Visio page, in the shapesheet image properties section or anywhere else I cannot find any cells that show the size of the original (PNG/JPG) image that was dropped on the page.

Is there a way to read this from the shapesheet, or is there a VBA method that can tell me the size of the original size of the image in pixels?
Visio 2021 Professional

Surrogate

Quote from: Visisthebest on October 27, 2021, 11:34:48 AM
Is there a way to read this from the shapesheet, or is there a VBA method that can tell me the size of the original size of the image in pixels?
IMHO In ShapeSheet this info don't stored
When i open Locals window i find there Picture node, which contain Width and Height properties !

I dont know which units used there ? Values in this properties more then 18 times than its real sizes in pixels which i can see in file description!
Sub Macro1()
Dim shp As Visio.Shape, p As Object
For Each shp In ActivePage.Shapes
Set p = shp.Picture
w = p.Width
h = p.Height
Debug.Print p, w / 18, h / 18
Next
End Sub

Visisthebest

Surrogate thank you this may be the way to get the size in pixels!
Visio 2021 Professional

Visisthebest

Drop the picture then store the initial pixel sizes works for me, if you resize the shape that contains the picture also the pixel size (width/18,height/18) change, but storing the initial values gives me the original picture size in pixels super.

Thank you Surrogate!
Visio 2021 Professional