Results 1 to 2 of 2

Thread: Problems with WindowsMobile.DirectX TextureLoader.FromFile

  1. #1

    Thread Starter
    New Member Rapid81's Avatar
    Join Date
    Jan 2010
    Posts
    11

    Problems with WindowsMobile.DirectX TextureLoader.FromFile

    I'm trying to develop a simple application to my Omnia 2 in DirectX in VB.NET, but i stuck, really hard. I want to load a simple texture from a file, but the TextureLoader.FromFile gave me an InvalidCallException error. I don't know what to do, because the code is working on the emulator, but throw this error on the phone. I googled it, a lot, but found nothing.
    I hope someone can help me in this.

    Here's some code fragment. Please someone help me.

    Code:
           Function InitializeGraphics() As Boolean
                Dim Parameters As PresentParameters = New PresentParameters()
                Parameters.Windowed = True
                Parameters.SwapEffect = SwapEffect.Discard
                DeviceForm = New Device(0, DeviceType.Default, Me, CreateFlags.None, Parameters)
                Me.OnCreateDevice(DeviceForm, Nothing)
                Return True
            End Function
    
            Private Sub OnCreateDevice(ByVal sender As Object, _
                ByVal e As EventArgs)
                Dim dev As Device = CType(sender, Device)
                spriteTexture = TextureLoader.FromFile(dev, "\Storage card\Picture.png")
                Using s As Surface = spriteTexture.GetSurfaceLevel(0)
                    Dim desc As SurfaceDescription = s.Description
                    textureSize = New Rectangle(0, 0, desc.Width, desc.Height)
                End Using
                sprite = New Sprite(DeviceForm)
            End Sub

  2. #2

    Thread Starter
    New Member Rapid81's Avatar
    Join Date
    Jan 2010
    Posts
    11

    Re: Problems with WindowsMobile.DirectX TextureLoader.FromFile

    Anybody? Please, I really need this to work. Nobody programming in DX? PLS!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width