c# - How to get the correct Image height and width -


i trying calculate size of rectangle using height , width of image in project. image (icon) 20px w , 16px h. when load in imagelist , @ image size, shows 16px x 16px.

i assume there compression being applied image, not experienced in area. need correct, dimensions. there way?

note: not loading file disk... in project.

this, simply, doing:

var tabpage = _tabcontrol.tabpages[e.index];  var image = _tabcontrolimagelist.images[tabpage.imageindex]; var imagehw = math.max(image.height, image.width); 

you can , must declare imagesize want have, before load images imagelist:

_tabcontrolimagelist.imagesize = new system.drawing.size(20, 16); 

afterwards images inside imagelist have following size: 20x16px.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

html - href attribute breaking an element -