codename one Resize Image quality - codenameone

My requirement is to show the small image into the bigger one at the same quality. I have tried setting the background image to the container, scaleImageLabel, ImageViewer by doing so I can achieve the required size but the quality is not good.
using cloudinary is the only option to go with or if there is any other option available.
Following code has been used.
ImageViewer iv = new ImageViewer();
iv.setImageInitialPosition(IMAGE_FIT);
iv.setPreferredH(Display.getInstance().getDisplayHeight() / 2);
iv.setImageNoReposition(vi.img);
Need to remove the blank space top and bottom
while using IMAGE_FILL image has been croped

Related

Auto Resizing Image

Lightbox2 is auto resizing the image in my lightbox to a maximum of 274 pixels wide and is stretching the height. I set the option to 1500 pixels wide with the options method but it does not fix this. I want the full image to show in the lightbox not some smaller and stretched version. Anyone know a fix or if this plug in is just broken?
To make your images expand to their full resolution, you will have to modify two files. Go to ../lightbox/js
Open lightbox.js and change
fitImagesInViewport: true,
to
fitImagesInViewport: false,
and save.
Then open lightbox.min.js and change
fitImagesInViewport: !0,
to
fitImagesInViewport: !1,
and save.
All images will show on full res instead of being downsampled to the viewscreen size.
I asked Lokesh to add a option that will show a little magnifier when the image has been downsampled so that the reader will see the full res image when clicking on it, but I'm not sure he will/can implement this, nor when.

Tagging dimensions and name on image codename one

I have an image( mechanical part of machine ) in my form in which I have to put some measurement like width and height, show arrows for inlet and outlet on image and display name near by each component. How do I proceed for this ?
Note : Width and height come from user as input, so all these dimension depends on user. Basically user will try to design a feasible model based on some calculations. These parameters need to be displayed on image.
If I understand the question correctly you are trying to draw on an image.
For that just create an Image using Image.createImage(width, height, ARGB_COLOR) that would generate a "mutable image" which means you can draw on it by invoking getGraphics() on the image and using the graphics to draw whatever you want (including other images). You can then save the image to a file using the ImageIO class.

Composite C1 - Image Compression

I have a Composite C1 site - a client is uploading photos to blog posts.
The photos are huge - 1.5MB. Is there a module to compress them (size & dimension wise)?
The crop module only crops & doesn't resize.
I have not found any such modules on Google. Thanks
UPDATE
I have added an aspect ratio - but it is greyed out (LPFF Preset Wide):
To simply resize an image (manually) already in the media archive:
Open it in the built-in Image Editor (in the Media perspective).
Image / Scale image... (or click the Scale button on the toolbar - 2nd from the left)
You can also crop the image in the same Image Editor:
Click the top button ("Select") on the floating bar. (The crop button on the toolbar will get enabled.)
Use the cursor to select an area on the image.
Click the crop button on the toolbar (3rd from the left)
If you are running a recent version of Composite C1 you can resize images you include in the Visual Editor either by pulling the corner of the image or invoking the image properties dialog and set a max width or height (advanced tab).
If you need a code centered fix you can append ?mw=100&mh=100 to the image URL and your image will be automatically resized.
In Composite C1 4.1 you can append ?q=80 to JPEG image URLs to have the web server do compression. The number controls the image quality (100 highest).
All these features are part of the standard open source product.

Download full size image link in drupal 7 gallery

I've created a little gallery in drupal 7 using views module and colorbox formatter for image field. The thing is, I'd like to provide url for full size image download. Mind You - "full size image" is not the same image that appears in colorbox overlay. In fact I don't have full size image at all, since I've limited max image dimension on upload (1000 x 1000px). And I'm not sure how to overcome this restriction.
So, user should be able to click on a thumbnail (100 x 100px) and view 1000px wide version of an image in colorbox overlay. And apart from that there should be download link to full size photo (4000px wide, for example) - preferably in an overlay, but may be on the gallery page as well.
I could just skip size limits on upload and pull the link from image src, but I wanted to save bandwith and speed up display. Well, creating a gallery full of 16 Mpx photos isn't the way to go, anyway.
Is there any clever way to achieve what I want, or do I just need to hack file upload module a bit?
Ok, I've found an answer. And it's pretty simple, now that I think of it.
Since image derivatives are created on the fly, I just needed to create another image style in admin/config/media/image-styles, 1000px wide and high, and remove upload limit in image field.
"Full size download link" may be then created by a regex in JS, just replace one path to image with another.

Multiscale Image Printing with Canves Overlay in Silverlight

We have a system in which we have big plan images loading in multiscale deepzoom images like an image gallery.Images are usually of very high resolutions.
Users have the ability to draw shapes ect on selected deepzoom image.We are using a canves on deepzoom image and save all overlay shapes drwan along with their logical poistion in db.thus the drawn shapes auto sets their position as user pans in or pans out.
We need an automated solution so we can take the printout of all the plan images along with all overlay work done on each deepzoom image.
Currently we are doing this one by one i.e we use Grid,Multistage,Canvas.We load image in Multiscale image,then draw Canves then we use following code to same them in jpeg from Grid(ContentGrid)
SaveFileDialog saveDlg = new SaveFileDialog();
saveDlg.Filter = "JPG Files (*.jpg|*.jpg|*.jpeg|*.jpeg)";
saveDlg.DefaultExt = ".jpg";
if ((bool)saveDlg.ShowDialog())
{
using (Stream fs = saveDlg.OpenFile())
{
SaveToFile(new WriteableBitmap(ContentGrid, null), fs);
}
}
But this solution does not work properly.This throws memory issues when deepzoom image is big one.
We want something like this.For all plans images in gallery we need to loop and programatically convert to jpeg along with canves etc and then save to Amazon s3 by program.An automation will pick all the jpegs and make a single pdf for all those.
or an automated solution.
Please suggest.

Resources