-
quicky !
i'm simply trying to find out the dimensions of an image opened in image pro plus (VBA) compatable.
the image is a .tif and it has been read into an array called ImBuf(Reg.Left,Reg.top). i now want it to work on cropped images, ie. different sizes.
i've tried putting: Reg.Right=ImBuf.Width
and Reg.Right=ImBuf().Width
and Reg.Right=DOCSEL_ACTIVE.Width
but they don't work and i get told there is a type mismatch (ImBuf is declared as an integer - is that part of the prob?)
i've only been programming less than 1 week so please help a newbie :)
thanx
J x
-
Re: quicky !
does reg have a right property?
most items only have a left and a width the left tells it or you where it is situated on its parent, the width is how wide it is, also somethings have a scalewidth, which is it's inside width,
same applies with top and height ( no bottom)
also the scale of the parent may be in twips, while the scale of reg or the image, may be in pixels
i have never seen image pro, so i am only going by general programming
pete
-
Re: quicky !
Prob solved 1 min ago!
thanks anyway, but i found the function UBound on the internet even though they aren't listed in the IPP functions!
i can just say
width=UBound(ImBuf,1)
height=UBound(ImBuf,2)
:)
-
Re: quicky !
aaagggggghhhhhhhhhh
prob NOT solved
i can't declare the array without knowing its size and i can't use UBound without declaring the array!
:(
-
Re: quicky !
if you don't declare the array, you can't store anything in it, so the size to declare the array is the quantity of data you want to store in it.
maybe with ImBuf(Reg.Left,Reg.top)
what is the maximimum value of reg.left, is that the number of pixels?
does reg.left have a count property?
also you can reset the rightmost dimension of the array and preserve the existing dat, using
redim pereserve imbuf(reg.left, newreg.top)
don't know if any of this helps you or is just more confusing
if the tif file has already been read into the array, it should already have a ubound, so in that case you, still have to load the tif for it to have any value to work with
pete
-
Re: quicky !
if you want to declare an array with no set length just leave the # out
IE) Dim strArray () as string
-
Re: quicky !
cheers guys, i eventually found the function below, but am having some probs... the whole prog just shuts down quite often when i run my code - sometimes with a "this app has encountered a prob..." and sometimes everything just suddenly disappears with no message. didn't think my code was THAT bad!
will try your advice and see if it still falls over :)
ret=IpDocGet(GETDOCINFO, DOCSEL_ACTIVE, iInfo)
ReDim ImBuf(1 To iInfo.Width, 1 To iInfo.Height)
-
Re: quicky !
do you set breakpoints or step through the code one line at a time, to find out exactly where it shuts down?
also use ubound to find out what the actual size of you array is after that
you may need to use dim, rather than redim
pete