Jump to content
  • Advertisement
Sign in to follow this  

[.net] Blending different sized images in GDI+?

This topic is 5195 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if there is a more elegant method of blending two different sized images in a greater one than blending them on a per-pixel basis. Let me explain: I'm writing a sort of lens flare generator in C# so I have various images: the glow part, the "rays" part. Depending on various parameters they are not always generated to be the same size. For example the glow image could be 512x512 while the "strike" only 512x16. I tried creating a "Graphics" object based on the first bitmap and calling the drawimage method on the second but nothing seems to happen so I was wondering if it is possible to blend two images "in one go" instead of comparing each pixel. Currently I'm just aligning them so that they share the same origin (by placing the smaller one inside the greater one) and blending like that. Also, on a side note, does anyone know where I can find books and/or algorithms detailing the process of creating lens flare effects? I was basing myself on the idx3d engine for Java, but I believe there's space for improvement. Particularly algorithms on creating rays, strikes and so on. Thanks again :)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!