RealTimeDesigner Support Network
Wiki Forums Libraries Docs Support RealTimeDesigner Home
Welcome! Log In Create A New Profile

Advanced

Foreground Masking Image

Posted by Admin 
Re: Foreground Masking Image
January 07, 2009 11:13AM
I'm back.
Interactive tool should be better now.
Even if there are small visual glitches, becasue of the floating point conversion between inches and relative pixel size, i made it so that the printable area size is mainteined in any case.
I discovered a general issue of javascript in doing floating point subtractions, my workaround should reduce the glitch to the minimum.
I made some tests with your image, and the generated PDF is now correctly set at 24x6 inches.

Please try it and let me know if it seems ok for you too.
cos
Re: Foreground Masking Image
January 07, 2009 01:19PM
Thanks Alex.

Interactive tool is better now. The bounding box that high res generation produces is correct at exactly 24x6. The size as listed in the low res texts is correct at 24x6.

Great.

Now, another issue. If something is placed in the drawing and stretched as large as possible from top to bottom it will will extend a little larger than the bounding box of 24x6 when hi res is generated. In my current setup this creates an image of 24.06 x 6.01.

This is okay when we are working with a few orders because it's easy to manually change the size. However, when working with many orders is too time consuming. (Of course, the goal is to process many orders). In a streamlined automated system with multiple orders set to print, accuracy is critical. 6.01 multiplied 16 times is .16 more than it should be and extends past the substrate.

I'm unsure if the way I am setting up in the mask process is correct. Have tried several methods. Please advise.
Re: Foreground Masking Image
January 07, 2009 08:46PM
Thinking out loud...

This is very interesting, and possibly a bit difficult.
Browsers, where customers design their stuffs, are naturally pixel based, not inches based.
So, when you have a product that's 24x6 inches, designer needs to "transform" it in pixels to make it visible and usable via browser.
This is actually done using the ratio of the inches width against the pixel width.
In "simpler" terms, that ratio is given by:
pixel_designer_width / (inches_width + inches_leftmargin + inches_rightmargin)
In other words, the overall pixel width and the overall inches width.
The height and all other pixel sizes used in designer are then calculated by multipling their inches values by that ratio.

The small error you found is probably because that ratio is almost always not an integer: so, it may happen that resulting pixel values are floats, which is not something possible for browsers. The small error is probably given by those small decimal points designer cannot show, but stores.

As i mentioned, i recently discovered about that javascript issue in doing floating point operations: what will be needed here is probably to check all the calcs made in designer itself, which are naturally many (and i mean... MANY!).

The workaround i used is ok for interactive margin tool only, so i will need some time in order to find a more global way to fix that designer-wide. My opinion about your issue is simply that it's given by all those small errors javascript does while doing simple operations (in our case, the ratio multiplier). Even a small glitch of 0.0001 at the end will cause something similar to the issue you described.

Sorry i wrote all of this, i just want to share my math thoughts so that, in case something sounds wrong to someone, anyone can help and suggest. I cannot really give a deadline for this as of now, as there really are so many lines of code to check.

Thank you for your patience
cos
Re: Foreground Masking Image
January 08, 2009 11:19AM
I often think out loud myself in hopes that something may be heard by myself or others that hasn't yet been considered.

I somewhat understand what you are saying. Don't waste any time on account of me. I'm not doing volume as yet that can't be fixed manually.

Thanks for your helping to solve my immediate problem - WHICH YOU HAVE DONE PERFECTLY!
Re: Foreground Masking Image
January 08, 2009 12:18PM
Thank you for your support.
This kind of discussion is really the way i love to build something strong!
Sorry, only registered users may post in this forum.

Click here to login