U++ framework
Do not panic. Ask here before giving up.

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: 14291
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: Mon Sep 21 01:22:58 GMT+2 2026

Total time taken to generate the page: 0.00614 seconds