How do I work with images in a portable class library targeting Windows Store Apps and WP7,WP8,WPF?

后端 未结 7 1038
忘掉有多难
忘掉有多难 2020-12-31 00:23

I am working on a first PCL that targets : WSA (Windows Store Application), WPF,WP7,WP8. We can say that it is a rolerdex kind of application, you have contacts , they have

7条回答
  •  礼貌的吻别
    2020-12-31 00:55

    My first instinct is to say no you shouldn't have images in your PCL given what you have described.

    But if I were going to do it images can be stored via resources in the different libraries and you can store a different image for each platform in there and then do an Environment inspection to determine what image to pull out. But this approach really only should be attempted if you need scale.

    By scale I mean you are open sourcing this library where 1000's of programs are going to use it. If this is for your own internal use for 3 or 4 apps, I would say don't bother save your self the headache. Just pass the image into the shared library or set it via a config and be done with it.

    Or just don't manage images via the PCL. Because image manipulation changes and is different on every platform, especially the ones you mentioned. And you are bound to run into some weird bug where it just doesn't work the same as it does on the other platforms.

提交回复
热议问题