Xlithan Posted September 17, 2017 Author Share Posted September 17, 2017 Good evening everybody.I've been researching for hours upon hours on how to place a PNG image onto frmMenu. I've got as far as getting the form to be transparent, but I can't seem to load the PNG using any of the methods I've found online. The closest I got was inserting the PNG into a picture box, but obviously there was no transparency.Is there a way to draw the PNG using the existing code from the engine? Using SkyWyre v10. Link to comment Share on other sites More sharing options...
Coyote Posted September 17, 2017 Share Posted September 17, 2017 Use LaVolpe alpha image control. Add it in components Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 17, 2017 Share Posted September 17, 2017 I'm pretty sure you can use a gif as an image on the form, it should support transparency. Link to comment Share on other sites More sharing options...
Xlithan Posted September 17, 2017 Author Share Posted September 17, 2017 I've tried working with LaVolpe's stuff but it doesn't work. When I ported it over to my project, the image didn't display.I'm going to try something else. I have some code that makes everything on the form transparent if the object is coloured vbCyan. So what I'm going to do is use a picture box and draw the image in using the current code in the project. The picture box will be coloured vbCyan so hopefully that should get the transparency and the PNG will be drawn with DirectX rather than just loaded.I'll let you guys know how it goes and if it works I'll share the method with people, if they want it. Link to comment Share on other sites More sharing options...
Xlithan Posted September 28, 2017 Author Share Posted September 28, 2017 Well it seems I couldn't get this to work the way I wanted to yet. I want it to draw a paperdoll onto picSprite on frmMenu, but in order to draw things, it first draws a black box, and I don't want it to do that as picSprite has a background image already.This is so incredibly frustrating. Link to comment Share on other sites More sharing options...
Xlithan Posted September 28, 2017 Author Share Posted September 28, 2017 Update: I managed to find some source that allows me to load a PNG into an ImageBox. This will suffice for now. I would have preferred to draw the image to a picture box that already has a loaded background image but the way the current graphics rendering script works I'm not sure if that will be possible. I may have a play around with it though as it doesn't seem right that I can only get a black background when drawing to picSprite.I've been playing around with this line which is responsible for that black background. I can change the colours, but alpha blending doesn't seem to be possible with it.Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(0, 255, 0, 0.5), 1#, 0 Link to comment Share on other sites More sharing options...
Coyote Posted September 28, 2017 Share Posted September 28, 2017 LaVolpe is super easy to use. Idk what went wrong but in my case adding it to the components and placing on the form was easy.To se image to the control you right click on the image and then properties.You can edit things there.You wont find any image control that is better than lavolpe for sure. Link to comment Share on other sites More sharing options...
Xlithan Posted September 28, 2017 Author Share Posted September 28, 2017 I managed to get one of LaVolpes snippets to work, and that was PNG to ImageBox. This is great, but I would much rather have the images drawn to a PictureBox, which I can do using existing code in the engine, but as I said above, I get that black box, which I don't want, and I don't believe it's as simple as changing an alpha value. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 28, 2017 Share Posted September 28, 2017 @xlithan Any reason you aren't just drawing to frmMenu? You said cyan was made transparent, have you tried making the backcolor of D3DColorRGBA(0, 255, 0, 0.5) into cyan?I don't know much about LaVolpe so I can't help with that. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 28, 2017 Share Posted September 28, 2017 I tested it a bit more and it does *technically* work, there is a lot of cyan placed around things, so I don't recommend doing it. Looks like you'll need to learn LaVolpe Link to comment Share on other sites More sharing options...
Xlithan Posted September 29, 2017 Author Share Posted September 29, 2017 Anything cyan will be transparent through the whole form. So if you have a cyan PictureBox, you'll actually see straight through to the desktop, rather than the forms background image.I have some LaVolpe source code but it's for PNGs in ImageBoxes, which is fine because it works. And I only need 4 ImageBoxes for clothes, beards and hairs and accessories. I would have preferred to draw them, but it's only for character creation so it's not a huge issue.I could easily just have a black picture box, and draw them onto it, but I'm stubborn and I want my character creation interface to look good, without black squares and shit.![alt text](http://era.draignet.uk/img/screens/charactercreate.png) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now