News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

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

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 198 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1058KB.
Tokens: post-login.
Cache hits: 13: 0.00159s for 26,733 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]