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 » Community » Newbie corner » Displaying raw image data
Displaying raw image data [message #39738] Mon, 22 April 2013 17:46 Go to previous message
keltor is currently offline  keltor
Messages: 73
Registered: February 2012
Member
Hey everyone,

Silly me, I started to think that I was getting more fluent with U++, yet here I am in the newbie subforum once again.

I have a library that draws some stuff in memory. The drawing can be accessed using something like obj->GetRGBA(); however it is raw data, namely an unsigned char * consisting of 4 bytes for each pixel.

The library does its magic and creates the raw data. I would like to draw it into a bitmap, ideally as a picture in an ImageCtrl. However, I am a little lost with Buffer, Raster and the like. I couldn't find any suitable documentation or examples, so here I am.

My goal would be to reuse the raw buffer as the data to plug directly into ImageCtrl, so that if eventually the data in the buffer changes, one can force a redraw without having to copy data. But I don't know it that can be achieved, much less how. So if someone with more experience with this kind of things can help me out, he would certainly have my gratitude.

To clarify a bit more the kind of data I'm dealing with: bytes 0 to 3 contain the RGBA info for point (0,0); bytes 4-7 for (1,0); and point (i,j) is at 4*(i+width*j). The buffer itself has no picture height/width information, but that can be obtained elsewhere.

Thanks for reading Smile

Keltor
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: compiling with MSC 10
Next Topic: ScatterCtrl / ScatterDraw - ShowLegend() problem and general Question
Goto Forum:
  


Current Time: Sun Jun 16 22:50:34 CEST 2024

Total time taken to generate the page: 0.01661 seconds