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

PNG in EO 3.0


Keny14
 Share

Recommended Posts

No no ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)

> EO 3.0 uses DirectX8 witch supports PNGs just change the image file and it should work

The graphics engine (D3D8) supports .png as you stated She is trying to make a control a .png format picture.

[http://www.xtremevbt…ead.php?t=77960](http://www.xtremevbtalk.com/showthread.php?t=77960)

This seems to be a code reference for what you are trying to accomplish. Although i didn't have a look myself, so don't hate if it isn't exactly what you are looking for.
Link to comment
Share on other sites

I don't see the reason to use GDI+ over GDI in this particular case. Even though the support for alpha-channel images is fairly limited, it does exist within GDI. However, it will be quite the tedious task to actually implement it without a sufficient amount of programming experience, especially in a niche language like Microsoft Visual Basic 6.

The first task is to actually be able to load PNG-images. The most general approach to this is to actually use libpng, for which sufficient documentation and code samples are present. Do keep in mind that the majority of these samples will be written in C.

Once the code has been written to load PNG-images, you'll be left with an array of bytes that represents the actual image, similar to an uncompressed bitmap, which you can then pass to [CreateBitmap](http://msdn.microsoft.com/en-us/library/dd183485%28v=vs.85%29) or any of the related functions to create an actual GDI bitmap. Here's the tricky part though, as the image contains an alpha channel, and as every channel does consume eight bits, you'll have to specify that every pixel will consume thirty-two bits in total. Normally, GDI will simply ignore this channel for most operations, or even reset it to zero values, so sometimes you do have to be careful.

After you've got a GDI bitmap, you can then draw it via the use of [AlphaBlend](http://msdn.microsoft.com/en-us/library/dd183351%28VS.85%29.aspx), or [TransparentBlt](http://msdn.microsoft.com/en-us/library/windows/desktop/dd145141%28v=vs.85%29.aspx). The prior seems to be favoured over the latter though.

There should be some articles that cover this entirely, but most of them will make use of C. Ideally, it should also be possible to create a control in Microsoft Visual Basic 6.0 that wraps this up for you, similar to the actual picture controls that Microsoft Visual Basic 6.0 has to offer.

Yours faithfully

S.J.R. van Schaik.
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...