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 » [SOLVED] accessing pixels in JPEG created from memory buffer
Re: accessing pixels in JPEG created from memory buffer [message #21426 is a reply to message #21423] Tue, 19 May 2009 18:33 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
luzr wrote on Tue, 19 May 2009 15:13

mrjt wrote on Tue, 19 May 2009 04:25

Make sure you add the package plugin/jpg to your project
[code]// Load raw image into memory
FileIn fin(IMAGE_FILE_PATH);
if (!fin.IsOpen())
{ Exclamation("Unable to open file"); return; }
String raw = fin.Get((dword)fin.GetSize());

// Convert String to uncompressed Image
Image img = StreamRaster::LoadStringAny(raw);
// If you know the image format you could also use:
// Image img = JPGRaster().LoadString(raw);



Or just:

Image img = StreamRaster::LoadFileAny(IMAGE_FILE_PATH);

Mirek

He already had the raw JPG in memory from an incoming MPEG stream. The first bit is merely illustative.

Incidentally, the first time I attempted to compile this the various image plugins were lised in TheIDE (SVN version compile two days ago), but weren't actually included in the build process. I had to add them to the project to compile it (which is what I would expect, but having them visible is misleading).
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Optimal ctrl refresh
Next Topic: Draw package and console app error
Goto Forum:
  


Current Time: Sat Apr 27 08:10:33 CEST 2024

Total time taken to generate the page: 0.05265 seconds