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 » Archive » DrawData and StoreImageAsString, how?
DrawData and StoreImageAsString, how? [message #3666] Mon, 12 June 2006 11:40 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
	Image img;
	img=aggImg(600,400);
//	w.DrawImage(50,50, aggImg(600,400)); //works
//	w.DrawImage(50,50, img); //works
	String ss=StoreImageAsString(img);
//	w.DrawData(50,50,600,400, StoreImageAsString(img), "image-data"); //??
	w.DrawData(50,50,600,400, ss, "image"); //??
//	w.DrawData(50,50,600,400, StoreImageAsString(img), "image"); //??
//	w.DrawData(50,50,600,400, PackRLE(img, img.GetLength()), "image-data"); //??

Any hints?
Re: DrawData and StoreImageAsString, how? [message #3667 is a reply to message #3666] Mon, 12 June 2006 11:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
Format resulting from StoreImageAsString is not valid for DrawData (maybe yet... and maybe the idea of StroreImageAsString is not right - it serves more or less to reduce the size of small applications - no need for .PNG in RichText....).

You can make it work by registering specific format for it (just like we will be registering AGG format).

Mirek
Re: DrawData and StoreImageAsString, how? [message #3668 is a reply to message #3667] Mon, 12 June 2006 13:17 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
luzr wrote on Mon, 12 June 2006 10:59



You can make it work by registering specific format for it (just like we will be registering AGG format).

Mirek


Why to register new format if I'm using upp native RGBA?
Edit:
P.S. What formats are "image" and "image-data"?

[Updated on: Mon, 12 June 2006 13:21]

Report message to a moderator

Re: DrawData and StoreImageAsString, how? [message #3670 is a reply to message #3668] Mon, 12 June 2006 15:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
fudadmin wrote on Mon, 12 June 2006 07:17

luzr wrote on Mon, 12 June 2006 10:59



You can make it work by registering specific format for it (just like we will be registering AGG format).

Mirek


Why to register new format if I'm using upp native RGBA?
Edit:
P.S. What formats are "image" and "image-data"?


OK, I owe you an extensive explanation I guess...

This is not about pixel format. This is more about rendering a complex data - those data can be anything, not only the array of pixels. The only specific is that the intemmediate "result" of drawing operation, as defined by DataDrawer, must be the Image band (as required by "Render" method).

There is no "image" format, only "image-data" (AFAIK Smile. This "image-data" is encoded image - it can be in any "file-format" currently supported by any plugin, e.g. BMP or PNG or JPG.

Now the advantage here is that this way, when creating a Drawing (e.g. Report), you can store the raster data in original, often compressed, form. This can be quite significant advantage as it can save tens of MBs in Drawing. And, as I have mentioned before, drawing to printer can and is optimized so that it works by bands and optimizes output by "RLE" - detecting significant areas of uniform colors and printing them using simple DrawRect. I believe that such areas are quite common in non-photo printouts.

Frankly, I have added this interface when dealing with one of my apps that stores and prints scanned documents. Then I have realized that this is the ideal tool to cope with sw renderers as well.

Mirek
Re: DrawData and StoreImageAsString, how? [message #3672 is a reply to message #3670] Mon, 12 June 2006 15:32 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
But we were talking about what hardware can recognize and what (in what format) is pumped to it. I'm not going to keep aggImg as bitmaps. I'm generating them "on the fly" - when required and to which device. How printers recognize packed RLE string?
Re: DrawData and StoreImageAsString, how? [message #3674 is a reply to message #3672] Mon, 12 June 2006 15:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
Printer does not recognize any RLE, but that is not what we are sending. We are sending a lot of "DrawImage" and "DrawRect" operations.

Note that even series of "DrawImage" ops without detecting uniform areas can be advantage - because printer is often monochrome and host OS will use much smaller buffer for processing...

Mirek
Re: DrawData and StoreImageAsString, how? [message #3675 is a reply to message #3674] Mon, 12 June 2006 16:18 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
luzr wrote on Mon, 12 June 2006 14:41

Printer does not recognize any RLE, but that is not what we are sending. We are sending a lot of "DrawImage" and "DrawRect" operations.

Note that even series of "DrawImage" ops without detecting uniform areas can be advantage - because printer is often monochrome and host OS will use much smaller buffer for processing...

Mirek



I'm sending only one aggImg (already formed from agg ops) for one Drawing (via DrawingDraw for resizing). I see only png compression possibility.
Printers capabilities should then be recognized by upp and pixel formats changed accordingly.

Re: DrawData and StoreImageAsString, how? [message #3681 is a reply to message #3675] Mon, 12 June 2006 18:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
fudadmin wrote on Mon, 12 June 2006 10:18

luzr wrote on Mon, 12 June 2006 14:41

Printer does not recognize any RLE, but that is not what we are sending. We are sending a lot of "DrawImage" and "DrawRect" operations.

Note that even series of "DrawImage" ops without detecting uniform areas can be advantage - because printer is often monochrome and host OS will use much smaller buffer for processing...

Mirek



I'm sending only one aggImg (already formed from agg ops) for one Drawing (via DrawingDraw for resizing).



Yes, I was afraid of that. Completely wrong. This way your only chance is to store extremely big Images (A4 page is 4000x6000 dots).

Instead, you should implement DataDrawer for recorded AGG drawing and return bands that can be converted and "RLE" compressed one by one.

BTW, perhaps it will help to understand the issue that DataDrawer implementation will repeatedly draw the "data" with changeing clipping (for individual bands).

Mirek
Re: DrawData and StoreImageAsString, how? [message #3685 is a reply to message #3681] Mon, 12 June 2006 19:02 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
What are bands?
Re: DrawData and StoreImageAsString, how? [message #3686 is a reply to message #3685] Mon, 12 June 2006 19:06 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
Horizontal strips of target raster, in this case with the same width and some small height.

Please check DrawData.cpp.

Mirek
Re: DrawData and StoreImageAsString, how? [message #3687 is a reply to message #3681] Mon, 12 June 2006 20:38 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
luzr wrote on Mon, 12 June 2006 17:19

Yes, I was afraid of that. Completely wrong. This way your only chance is to store extremely big Images (A4 page is 4000x6000 dots).

Mirek



I'm not storing Images in pixel format. I'm storing only agg paths and whats related to make an Image.
Previous Topic: Agg works with upp Ctrl's! - download and test the new package...
Next Topic: merged in yet
Goto Forum:
  


Current Time: Thu Dec 03 15:08:53 CET 2020

Total time taken to generate the page: 0.01045 seconds