Jump to content

  • Log In with Google      Sign In   
  • Create Account


Is it possible to disable colorKey when loading an Image?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 vanattab   Members   -  Reputation: 194

Like
0Likes
Like

Posted 27 September 2012 - 02:21 PM

I am trying to get the MDX9 Surface.FromBitmap() functionality with SlimDX. I think I need to use the SlimDX.DX9.Surface.FromFile() method but all of the overloads of that method take a colorKey argument. What do I do if I want to render all of the colors?

Sponsor:

#2 vanattab   Members   -  Reputation: 194

Like
0Likes
Like

Posted 27 September 2012 - 03:45 PM

Also I am getting a D3DXERR_INVALIDDATA exception when I call the Surface.FromFile( ) method. I know that the path to the file is correct.

[source lang="vb"] Public Overridable Sub CreateDeviceResources() Dim str As String = Application.StartupPath & "\phoriaRing.bmp" test = Surface.CreateOffscreenPlain(device, 150, 150, Format.A8R8G8B8, Pool.Default) Surface.FromFile(test, str, Filter.Default, 8) End Sub[/source]

I tried enabling the debug runtime but its not much help:

Direct3D9: (INFO) :======================= Hal HWVP device selected
Direct3D9: (INFO) :HalDevice Driver Style b
Direct3D9: :Subclassing window 000d04ba
Direct3D9: :StartExclusiveMode
Direct3D9: (INFO) :Using FF to VS converter
Direct3D9: (INFO) :Using FF to PS converter
Direct3D9: (INFO) :Enabling multi-processor optimizations
Direct3D9: (INFO) :DDI threading started
D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 5.80233e-315f, not 5.51222e-315f.  This is ok.
A first chance exception of type 'SlimDX.Direct3D9.Direct3D9Exception' occurred in SlimDX.dll
An unhandled exception of type 'SlimDX.Direct3D9.Direct3D9Exception' occurred in SlimDX.dll
Additional information: D3DXERR_INVALIDDATA: Invalid data (-2005529767)

Ok I managed to get the Surface.FromFileInStream() working but I have to know the Size of the image and everything in advance. What if I don't know the size of the image. I guess I could load the File in a Image object and then record the information and then do a FromFileInStream but that seems like poor efficiency. There has to be a better way.

Edited by vanattab, 28 September 2012 - 07:42 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS