Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Form Transparency and PNG Drawing


Xlithan
 Share

Recommended Posts

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

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

  • 2 weeks later...
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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...