English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. AMOS (http://eab.abime.net/forumdisplay.php?f=119)
-   -   Get Icon size? (http://eab.abime.net/showthread.php?t=94970)

volvo_0ne 03 November 2018 20:48

Get Icon size?
 
Hi
Does anyone know how to get the absolute size (width/height) of an Icon image from the icon bank?

I have several icons from 16x16px up to about 128x64px however I want to put them on screen with a zone around them so I would like to know the dimensions as it's pasted on screen.

TIA

V1

adrazar 12 November 2018 01:59

I'm pretty sure the only way is to read it from the data structure manually. :/

The code looks something like this:
Code:

IMGADR=Leek(Start(2)+IMG*8+2)

WIDTH=16*Deek(IMGADR)
HEIGHT=Deek(IMGADR+2)

In this code example the first icon (number 1 in the bank) is found by choosing IMG=0.

volvo_0ne 13 November 2018 19:56

Quote:

Originally Posted by adrazar (Post 1284409)
I'm pretty sure the only way is to read it from the data structure manually. :/

The code looks something like this:
Code:

IMGADR=Leek(Start(2)+IMG*8+2)

WIDTH=16*Deek(IMGADR)
HEIGHT=Deek(IMGADR+2)

In this code example the first icon (number 1 in the bank) is found by choosing IMG=0.

Excellent!
That does exactly what I want.

Many many thanks for your help.

V1


All times are GMT +2. The time now is 18:52.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.

Page generated in 0.07042 seconds with 11 queries