Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » blending images
blending images [message #9876] Tue, 05 June 2007 21:47 Go to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
I'm a little confused reading through the Draw documentation in that it appears that most of the stuff I am interested in is no longer available and its hard to know what to believe in the documentation.

More confusing still is the existence of IMAGE_ALPHA within ImageBuffer. This implies it is possible to do some kind of alpha blending which would be fantastic. Unfortunately though there don't appear to be any examples of how this would be used.

To give some context, I have a habit of making GIS style applications with layers. These layers are quite often images or rasters and have different sizes and offsets.

What I am trying to do just now is to have some level of transparency or blending of the layers. From looking through the available functions it appears that I my simplest option would be: to make foreground and background ImageDraw objects that are the size of my mapping window; draw the foreground image(s) and the background image(s) using DrawImage(); convert the two ImageDraw objects to ImageBuffer objects; implement my own blending algorithm (not so bad really) with the background ImageBuffer as the destination; then convert the background ImageBuffer to an Image and use DrawImage to paint it on the window.

I am fine with the above. My question is: am I missing an easier way to do this please?

Cheers,

Nick

[Updated on: Tue, 05 June 2007 21:49]

Report message to a moderator

Re: blending images [message #9877 is a reply to message #9876] Wed, 06 June 2007 08:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Alpha blending is fully supported, in fact, all images have now very regular and easy to work with RGBA format (32 bits per pixel).

"IMAGE_ALPHA" is only the "kind of Image": To optimize performance, U++, before sending the image to host platform GUI, tests the kind of image. IMAGE_ALPHA means that image contains pixels with alpha values other than 0 or 255. Unless you are doing something very specific, you can ignore this image kind - you are supposed to work with RGBA only.

I think Image tutorial is quite comprehensive:

http://www.ultimatepp.org/srcdoc$Draw$ImgTutorial$en-us.html
Re: blending images [message #9901 is a reply to message #9877] Thu, 07 June 2007 19:51 Go to previous message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Thanks Mirek,

I see its all very simple. You've given us all the tools we need to work with to do everything ourselves. Am still getting used to that idea but I like it more and more. I am currently writing a bunch of tools to manipulate images so when you start getting the advanced image package together I'd be interested in contributing (ideas even if my code isn't quite up to your high standards).

I just wanted to be sure I wasn't missing out on something but in the end, alpha blending was not what I wanted and I wrote code which blends greyscale with color images to show both types of info without compromising the other - very nice Smile

Thanks again,

Nick


Previous Topic: Delayed Image Loading
Next Topic: AGG again
Goto Forum:
  


Current Time: Fri Apr 19 21:51:22 CEST 2024

Total time taken to generate the page: 0.03004 seconds