Announcement

Collapse
No announcement yet.

VRayBitmap and image dimensions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VRayBitmap and image dimensions

    With the standard bitmap, you can do the following:

    Code:
    myMap = Bitmaptexture fileName:"C:\test.png"
    myWidth = myMap.bitmap.width
    myHeight = myMap.bitmap.height


    I have not figured out how to do the same with the VRayBitmap. The property .bitmap in the Bitmaptexture is a special bitmap controller, but in a VRayBitmap, the .bitmap property is just a text string. Is there a way to query the map pixel dimensions with a VRayBitmap?

    Thanks
    =======================
    Ray Collett - Design Visualization Specialist
    WSP USA - Visualization and Data Intelligence
    Visualization & Data Intelligence Portfolio (vizportfolio.com)
    =======================

  • #2
    For VRayBitmap you can use the method below:
    Code:
    myBitmapFile = "C:\test.png"
    myMap = VRayBitmap HDRIMapName:myBitmapFile
    myWidth = (getBitmapInfo myBitmapFile)[3]
    myHeight = (getBitmapInfo myBitmapFile)[4]
    But with this method you may have problems getting the dimensions from the tiled .tx texture. Then you can use the second code:
    Code:
    myBitmapFile = "C:\test.tx"
    myMap = VRayBitmap HDRIMapName:myBitmapFile
    myBitmapInfo = (dotNetClass "System.Drawing.Image").FromFile myBitmapFile
    myWidth = myBitmapInfo.Width
    myHeight = myBitmapInfo.Height
    myBitmapInfo.Dispose()
    ​​​
    Last edited by 3DZver; 24-03-2024, 06:22 PM.
    V-RayMax Converter PRO
    MAXTools

    Comment

    Working...
    X