PrimalJohnScott Posted July 9, 2015 Share Posted July 9, 2015 The tl;dr is that I wish to view the mips of an image, and if each mip was loaded as a separate image or layer, this would be fine. The native DDS support is great, but doesn't seem to allow viewing of mips (in fact, nothing I can find does). I'm writing my own texture format reader/writer (for reasons not pertinent to this thread), and it seems that there is a 1:1 correlation between files and images, and no way to create layers in the OnLoad() delegate.What I could do is create a bigger single image that shows all mips. However, this would not be savable. Is there a way to create multiple images or layers from a single OnLoad() call? Cheers John Quote Link to comment Share on other sites More sharing options...
midora Posted July 9, 2015 Share Posted July 9, 2015 You can not return more than one doc (image) from OnLoad. But the doc may contain multiple layers in the size of the documunt. So you have split the input stream into multiple bitmaps and add these bitmaps as layers. bitmap = new Bitmap(ms); Surface surface = Surface.CopyFromBitmap(bitmap, false); BitmapLayer bitmapLayer = new BitmapLayer(surface); bitmapLayer.Name = "Layer N"; bitmapLayer.Visible = true; bitmapLayer.SetBlendOp(new UserBlendOps.NormalBlendOp()); bitmapLayer.Opacity = 255; doc.Layers.Add(bitmapLayer); bitmap.Dispose(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.