Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

how to know image dimensions? #885

Open
an146 opened this issue Aug 15, 2019 · 1 comment
Open

how to know image dimensions? #885

an146 opened this issue Aug 15, 2019 · 1 comment

Comments

@an146
Copy link

an146 commented Aug 15, 2019

I've tried to modify function icon_load, but it never renders now. I want to nk_image.{w,h} to be filled and respected when drawing button icon (icon being scaled preserving aspect)

@molecularentropy
Copy link
Contributor

Whatever you're using to load the image should give you the size, as specified in the image file. You'll have to fill these (x, y) in yourself. If you're using stbi_load_*(), then you'll notice it takes an x and y pointer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants