[fixed] BitmapImageSource does not fully render images (1 Viewer)

sccrgoalie1

Portal Pro
September 12, 2013
109
165
38
Home Country
United States of America United States of America
I'm attempting to use BitmapImageSource to improve rendering of images in my plugin but it doesn't appear to work properly in MPF. My code below works in WPF with BitmapImage but in MPF the picture all only partially load. Am I doing something wrong or is there a bug in BitmapImageSource?

Code:
<Image Stretch="Uniform" Margin ="{Binding Path=PictureBorderMarginsProperty}" Thumbnail="false" Width="{Binding Path=PictureWidthProperty}">
                            <Image.Source>
                                <BitmapImageSource DecodePixelWidth="{Binding Path=PictureWidthProperty}" UriSource="{Binding Path=PictureImageProperty}"/>
                            </Image.Source>
                        </Image>

I get slices of pictures that go the entire height but do not fill the entire width.
 

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Can you check if the result changes if you omit the DecodeWidth from BitmapImageSource?

    I recently changed the class to use FreeImage to support more image formats than inbuilt DX. Maybe I introduced a bug there...
     

    sccrgoalie1

    Portal Pro
    September 12, 2013
    109
    165
    38
    Home Country
    United States of America United States of America
    Can you check if the result changes if you omit the DecodeWidth from BitmapImageSource?

    I recently changed the class to use FreeImage to support more image formats than inbuilt DX. Maybe I introduced a bug there...
    If I omit the Decode Width, the full image is rendered.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Can you please test this:
    Look at TextureAssetCore, line 132:
    C#:
              // Scale down larger images
              image = ResizeImage(image, MAX_TEXTURE_DIMENSION, MAX_TEXTURE_DIMENSION);

    And put in _decodeWidth / _decodeHeight. Does this fix the issue?

    then it would be best to use Math.Min(_decodeWidth , MAX_TEXTURE_DIMENSION) etc.
     

    sccrgoalie1

    Portal Pro
    September 12, 2013
    109
    165
    38
    Home Country
    United States of America United States of America
    Can you please test this:
    Look at TextureAssetCore, line 132:
    C#:
              // Scale down larger images
              image = ResizeImage(image, MAX_TEXTURE_DIMENSION, MAX_TEXTURE_DIMENSION);

    And put in _decodeWidth / _decodeHeight. Does this fix the issue?

    then it would be best to use Math.Min(_decodeWidth , MAX_TEXTURE_DIMENSION) etc.
    Sure I'll check it out.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    If this works, can you please create a new branch (based on DEV) in MP2 repo and commit a fix there?

    I'm not sure if the permission are already set, if not I will check it. I can also assist if you have questions to git usage.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Could you fix the image decoding issue? Anything I could support?
     

    sccrgoalie1

    Portal Pro
    September 12, 2013
    109
    165
    38
    Home Country
    United States of America United States of America
    Not yet. I've been just replacing the SkinEngine.dll after I make changes but so far nothing changes. I'm assuming I need to get a new build as I'm still running Alpha 3. I got a build from the IRC bot, MP2 doesn't launch after installing that, so at the moment I'm looking into the other build instructions. After I get a build installed of the latest master I'll try making the changes again.
     

    Users who are viewing this thread

    Top Bottom