-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After install Nuget pakcage image getting large #32
Comments
@amnk2015 can you post some example code here? We need to know what you're page is doing to know what's wrong, thanks! |
Thanks @jonathanpeppers for reply. I found my code issue. This is my code to get image. <controlsCommon:ImageButton Padding="10,5,10,5" HorizontalOptions="End" Source="{ext:ThemeImageResource menu.png}" Command="{Binding MenuCommand}" /> This issue coming because of ThemeImageResource extension. Can you please give me good suggestion to solve this. is it good way to load image using extension? using System;
using Xamarin.Forms;
namespace MyApp.ServiceMgt.Extensions
{
[ContentProperty("Source")]
public class ThemeImageResourceExtension : ImageResourceExtension
{
public override object ProvideValue(IServiceProvider serviceProvider)
{
return Source.GetResourceImageSource(true);
}
}
} |
Thanks @amnk2015, can you post a little more code? What is the source for Basically we need to add your issue here to our sample project--I go through and manually test it between each release. |
Please check this code. using Xamarin.Forms;
using Application = MyApp.ServiceMgt.Code.Application;
namespace MyApp.ServiceMgt.Extensions
{
public static class ImageFunctions
{
public static string GetResourceImagePath(this string imagePath, bool useTheme = false)
{
return string.IsNullOrEmpty(imagePath) ? null
: string.Format("MyApp.ServiceMgt.Images.{1}{0}", imagePath,
useTheme ? Application.Instance.Configuration.Theme + "." : string.Empty);
}
public static ImageSource GetResourceImageSource(this string imagePath, bool useTheme = false)
{
var result = GetResourceImagePath(imagePath, useTheme);
return string.IsNullOrEmpty(result) ? null : ImageSource.FromResource(result, typeof(ImageFunctions));
}
}
} |
So this is nothing to do with your markup extension, etc. It is something to do with Can you upload the actual image file here? If it's OK with you, I will put it in the sample app in this repo. One last question: what is |
This is the Image button control code <?xml version="1.0" encoding="utf-8" ?>
<StackLayout xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.Common.Controls.ImageButton"
Orientation="Horizontal">
<Image x:Name="Image" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Aspect="AspectFit" IsVisible="False" />
<Label x:Name="Label" VerticalOptions="CenterAndExpand" IsVisible="False" />
</StackLayout> this is the images |
* Cleanup `.csproj` in general * Rework `MainPage` to use `ListView` Added sample for: #32
@amnk2015 I tried using your image, but things were working for me: a908872 Is it possible you are hitting a variation of: #10 (comment) and #34 ? Currently I would recommend using |
Same issue here, the images are huge after adding the NuGet package. |
@mknotzer I was having some trouble reproducing this one. Would you be able to make a sample showing it? Thanks! |
I had install this nuget pakcage to my existing project. after that my images are getting large size. this will explain my issue.
https://forums.xamarin.com/discussion/153086/super-fast-image-loading-for-android-apps-with-glidex-issue/p1?new=1
The text was updated successfully, but these errors were encountered: