Returns information about a image file. This method works in conjunction with AddPictureFrame.
Rhino.ImageInfo (strFileName)
strFileName |
Required. String. The name of the image file to query. The supported image types are as follows:
|
Array |
An array of image information if successful. The array will contain the following information:
|
||||||||||
Null |
If not successful, or on error. |
Sub AddPictureFrameOneToOne()
Dim bmp, info, pl
Dim pw, ph, px, py
Dim us, uw, uh
bmp = Rhino.OpenFileName("Open", "Image Files (*.jpg)|*.jpg|All Files (*.*)|*.*||")
If IsNull(bmp) Then Exit Sub
info = Rhino.ImageInfo(bmp)
If IsNull(info) Then Exit Sub
pw = info(0) ' width in pixels
ph = info(1) ' height in pixels
px = info(2) ' horizontal pixels per inch
py = info(3) ' vertical pixels per inch
us = Rhino.UnitScale(8) ' unit scale factor
uw = pw / (us * px) ' scaled width
uh = ph / (us * py) ' scaled height
pl = Rhino.WorldXYPlane
Call Rhino.AddPictureFrame(pl, bmp, uw, uh)
End Sub