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 #21423 is a reply to message #21417] Tue, 19 May 2009 16:13 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
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
 
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 14:00:29 CEST 2024

Total time taken to generate the page: 0.04698 seconds