Skip to content

FillRectangle with SetFillImage only works on Android #29900

Open
@jgore-esriuk

Description

@jgore-esriuk

Description

I'm following the documentation to load an image from assembly, set this as the canvas fill image, and then use fill rectangle to fill the canvas with the image. This works fine on Android, but nothing is displayed on Windows.

Steps to Reproduce

  1. Grid in main page with Graphics View as child
  2. Link to drawable class
  3. Load image using:
            using (
                var stream = assembly.GetManifestResourceStream(
                    "FillRectangleBug.Resources.Images.splashtile.jpg"
                )
            )
            {
                image = PlatformImage.FromStream(stream);
            }
  1. Display image using:
            if (image != null)
            {
                canvas.SetFillImage(image);
                canvas.FillRectangle(0, 0, dirtyRect.Width, dirtyRect.Height);
            }

Link to public reproduction project repository

https://github.com/jgore-esriuk/fill-rectangle-bug

Version with bug

9.0.70 SR7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

                float starty = 0;
                while (starty < dirtyRect.Height)
                {
                    float startx = 0;
                    while (startx < dirtyRect.Width)
                    {
                        canvas.DrawImage(image, startx, starty, image.Width, image.Height);
                        startx += image.Width;
                    }

                    starty += image.Height;
                }

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingplatform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions