Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[vb.net, Microstation V8i, Microstation CE] Activate Transparency of Raster images

$
0
0

Good morning gents,

 I am trying to activate the transparency of a raster image in two different (almost twin) applications: one application uses the MicroStation V8i interoperability, while the other one uses the MicroStation CE interoperability. Here the code that is identical in both the applications:

    Dim RasMan = MstnApp.RasterManager'Attach raster
    Dim mRas = RasMan.Rasters.Attach(rasterFile, CByte(MsdViews.msdViewAll),
                                     MsdAttachMode.msdAttachReference,
                                     MsdFileAccessMode.msdFileAccessModeReadWrite, "", "")

    Dim ri = mRas.RenderingInformation
    ri.Transparency = True
    ri.TransparencyColorLevel = 100
    ri.TransparencyColor = RGB(255, 255, 255)

Both MicroStation V8i and MicroStation CE raise the same exception in correspondence of instruction: TransparencyColorLevel = 100:

“Transparency information is not available”

 I also develop a simple VBA macro both in MicroStation V8i and MicroStation CE with the same scope in order to find a solution. Here the macro source code

Public Sub TransparencyTest()
  Dim k As Integer
  Dim RasMan As RasterManager
  Dim ri  As RenderingInformation
  Set RasMan = Application.RasterManager
  For k = 1 To RasMan.Rasters.Count
    Set ri = RasMan.Rasters.Item(k).RenderingInformation
    ri.Transparency = True
    ri.TransparencyColorLevel = 100
    ri.TransparencyColor = RGB(255, 255, 255)
  Next
End Sub

In MicroStation v8i, macro was completed successfully, while in MicroStation CE, the same exception occurred.

 Any ideas to solve this issue?

thanks


Viewing all articles
Browse latest Browse all 7260

Trending Articles