Using MvxImageViewLoader to load a resource image, is it possible? - xamarin.ios

I'm using mvvmcross binding in a MvxTableViewCell, the cell elements are an UIImageView and 2 labels.
These "rows"/cells will list a set of predefined elements, the image of these elements are png files that exist inside the Resources directory (bundle resource) or at any place on the internet.
Since I might have this mix of images that exist in the bundle and on the internet I would like to use MvxImageViewLoader.
The view model has a list of objects that contain a property that is the image uri, for the resource images I tried several solutions:
- NSBundle.MainBundle.ResourcePath+"/xpto.png"
- "file://" + NSBundle.MainBundle.ResourcePath+"/xpto.png"
All the images that are located in the internet work without any problem.
Is it possible to use MvxImageViewLoader to load images that exist in the resource folder? Should I use a converter?
Thanks for your help,
Luis Pinho

The MvvmCross DownloadCache plugin on Touch resolves image loading to: MvxTouchLocalFileImageLoader - see https://github.com/slodge/MvvmCross/blob/v3/Plugins/Cirrious/DownloadCache/Cirrious.MvvmCross.Plugins.DownloadCache.Touch/MvxTouchLocalFileImageLoader.cs
This uses res: as the scheme/prefix to detect whether a resource file has been requestd and then uses UIImage.FromFile to load them.
Since other platforms do not support resource files using the same prefix, you may find you need to use a value converter for this when moving to multiple platforms.
Alternatively, you could easily implement your own MyImageView control inheriting from MvxImageView which would intercept the bound property and decide whether to download it or to display it from resources.

Related

How to change the size of the images through the magnolia cms imaging module

I have put the jar file inside the library of my magnolia(https://nexus.magnolia-cms.com/#nexus-search;classname~ImagingServlet), but when I invoke the url to return the cropped image, I get an error, if someone can help me.
[this is what appears to me1
I would guess that you are either missing the destinations folder or user has no access to it. Alternatively you are missing imaging support for DAM - see more at various additional jars you might need in documentation.
Also it seems you just copied thumbnail link from the admincentral, so perhaps you might want to read more on using themes and predefined image variations.

Mass Classification Attribute Removal

I was wondering if anyone else has gone though a massive classification restructure process, and knew of a way to efficiently remove attributes from a classification. Preferably via the MXLoader, or the import/export functionality built into Maximo. I know going into every individual classification that needs to have some specific attributes removed can be achieved, just hoping someone might know a better way to accomplish this.
Essentially what I am hoping to accomplish is the following with out going directly through the UI for each classification.
Pre-update
Classification A
(Attribute 1
Attribute 2
Attribute 3
Attribute 4
Attribute 5)
Post update
Classification A
(Attribute 1
Attribute 2
Attribute 5)
I have tried to export the .csv file using the object structure we have built supporting classstructure, classspec, and classusewith then imported the file back post removing an unwanted attribute using the sync function, but was not successful and not 100% sure where to go from there if the feat is indeed possible via theses means.
Thanks ahead of time for any potential help/support.
To do this with a data load, you'll need to load XML, not flat / CSV. This XML file will need to be loaded via the External Systems > Enterprise Services tab, after you've built an Enterprise Service for your Object Structure and associated that Enterprise Service with an External System. Your top level tag, for a given classification, will need to have attribute action="Change" and the child tag for the attribute will need to have an attribute of action="Delete". With a little string concatenation in your spreadsheet tool, you should be able to easily upcycle your CSV into the necessary XML.

What does .sprite file refers to?

I'm using Liferay Portal 6, The .sprite file is not specified in the source code, however, it's included in the URL with a slash dot, then it's blocked by a security program.
When I delete those file in theme/docroot/images and I deploy the project, they are generated again.
I would like to know how to manage those files or rename them?
You can open those files: It's combined images - look up "CSS Sprite" for a thorough documentation. They're used to limit the number of requests that go back to the server. Without sprites, you'd have every theme image loaded individually. With them you only need the sprite once, resulting in a significant performance boost: You want to have as few http-requests per page as possible, and sprites are one automatically handled way to help you achieving this.

Kofax Capture custom module(panel) for annotation

I am trying to figure out what would be the best way(if possible) to enable Kofax Capture users to annotate tiff images while processing them (preferably in Validation step in Kofax Capture/KTM. I do have a Atalasoft DotImage library that can annotate pdf and tif files, so I have to figure out how to develop this custom module/panel and plug it in validation screen so users can use it to burn annotations into images in the batch.
Thanks,
Goran
First: Only KC validation can use a custom panel, and if you are already or intending to use KTM Validation, you won't want to switch to KC Validation.
KTM interactive modules have functionality called sticky notes. This built in functionality lets a user add a note to any location of an image. These notes are then accessible via the document object in script (pXDoc.Annotations). These do not burn into the image out of the box, however you could let the users use this interface then use the Batch_Close event to loop through documents and access the notes they have created. Make sure you check the close mode so you don't take action when the batch suspends or closes in error.
At that point you might go different routes:
Modify the images directly from Validation's Batch_Close event - KTM script can only see COM visible assemblies and I believe Atalasoft is not. So you will need to create your own COM visible assembly which takes coordinates and text from the note. Then call this in Batch_Close to annotate your image.
Store the text and coordinates to modify the image later - You might to use Batch_Close just to get the data out of KTM and into either KC Custom Storage Strings or an external file alongside the images. Then you would write a KC custom module to use that data to modify the image.
The second option might be more work, but my instinct is to avoid any complexity in interactive modules.

SharePoint: Site Collection Images vs Images vs Style Library Images

Something I've been wondering. Is there a best practice or rule of thumb on how to store your images? I see 3 ways currently:
Site Collection Images
Images library
Style Library/Images
My rule of thumb has been: if you have only 1 site collection for your project, then use the Site Collection Images. Otherwise, create a folder structure like: /Style Library//images.
What is the difference between Site Collection images and the Images library?
Images lib provides a thumb view by default while the Style lib/images just treat images as files.
Site collection images? I think it's just another name of the Style lib/images of the top site.
Site Collection Images is a carry-over document library from the 2007 Publishing Feature. It's a document library but with multiple content types assigned to it (Image, Audio, Video). There's a thumbnail view associated with some of the content types so you get a nice preview of an image.
Images is a new library called and Asset library but in reality and behind the scenes, it's exactly the same as the old Site Collection Images document library with the three custom content types assigned to it. The only difference I can see is the icon used for the library.
Style Library is just a regular document library with no content types associated with it. It's created as part of the Publishing feature and pre-populated with some basic images, css files, and xsl style sheets (that are used with the DataView Web Part).
My standard (if you want to call it that is this).
A new folder for your site in the Style Library (sitename) with subfolders of "css", "js", and "img". The reason for this naming is that some libraries, plugins, and other addons will look for this type of structure (with CSS doing a relative path to an "img" folder to look for images). So it keeps things compact and identifable.
I choose to put CSS, JavaScript and Images here rather than creating separate libraries for it all. CSS is for (obviously) style sheets. JS is for javascript. This would include jquery (in the root js folder) or jQuery plugins (in a separate folder for each plugin). IMG is for CSS icons, system icons (e.g. twitter badges, etc.). I find this layout just handy and doesn't hurt anything keeping it all together.
I put regular photo content into Site Collection Images since a) it gets automatically populated when you create a publishing site or activate the feature and b) it's easy to find when inserting pictures into a rich content field. I'll just hide or tell the users to ignore the Images library (it can't be deleted because it's part of the Publishing Feature).
Hope that helps. YMMV.
I'd add that the style library is also different in that it's contents are readable by all users even if you have removed their permissions to the library or an item within the library.

Resources