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 » U++ Core » Handle a RGBA* with ImageBuffer
Handle a RGBA* with ImageBuffer [message #28930] Tue, 28 September 2010 08:25 Go to next message
koldo is currently offline  koldo
Messages: 3358
Registered: August 2008
Senior Veteran
Hello all

I have got a RGBA * from SDL with the same structure than ImageBuffer.

Is it possible to set that RGBA * to ImageBuffer so that U++ drawing functions can be used over it?


Best regards
Iñaki
Re: Handle a RGBA* with ImageBuffer [message #28931 is a reply to message #28930] Tue, 28 September 2010 10:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Not at the moment.
Re: Handle a RGBA* with ImageBuffer [message #28956 is a reply to message #28931] Wed, 29 September 2010 10:18 Go to previous message
koldo is currently offline  koldo
Messages: 3358
Registered: August 2008
Senior Veteran
Hello Mirek

Well, no problem, as it seems the pixels are not formatted exactly the same.

Finally I have focused this way. This a sample:
player.WhenFrame = THISBACK(OnFrame);            // OnFrame user function to be called every time there is a new video frame
...
void OnFrame(SDLSurface &surface) {                // SDLSurface is a new class to handle SDL painting. surface includes the video frame bitmap
    ImageDraw iw(100, 40);                        // Sample U++ paint
    iw.DrawEllipse(0, 0, 100, 40, Green());
    iw.DrawText(35, 10, "U++", Arial(18).Bold(), Black()); 
    
    surface.Lock();    
    surface.DrawImage(iw, 20, 20, Black());        // Copy the drawn U++ to SDL
    surface.DrawLine(0, 0, surface.GetWidth(), surface.GetHeight(), White());    // Directly draw other things
    surface.Unlock();
}

Result:

index.php?t=getfile&id=2848&private=0
  • Attachment: dib.PNG
    (Size: 116.07KB, Downloaded 279 times)


Best regards
Iñaki
Previous Topic: How to catch a dll exception
Next Topic: no true Iterator support in Upp???
Goto Forum:
  


Current Time: Mon Apr 29 19:44:30 CEST 2024

Total time taken to generate the page: 0.01867 seconds