Skip to content

[Android][DrawImage]Under Android, canvas. DrawImage is not displayed completely #13639

Closed
@nengxingxu

Description

@nengxingxu

Description

Under Android, canvas. DrawImage is not displayed completely, and iOS is normal

1677748118396_F9271A76-B0F5-4df9-A610-690C0D5B1C92

The size of the image is equal to the canvas area multiplied by the device density.
`
float density_ = (float)DeviceDisplay.Current.MainDisplayInfo.Density;
if (density_ > 1)
{
graphics_view_.WidthRequest = image.Width / density_;
graphics_view_.HeightRequest = image.Height / density_;
graphics_view_.Invalidate();
}

IImage image = PlatformImage.FromStream(mem_stream);
canvas.DrawImage(image, 0, 0, dirtyRect.Width, dirtyRect.Height);
`

Steps to Reproduce

As shown in https://github.com/gudder/repository/tree/main/MauiAppAndroidDrawImage

Link to public reproduction project repository

https://github.com/gudder/repository/tree/main/MauiAppAndroidDrawImage

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12(API 31)

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingarea-imageImage loading, sources, cachingpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been revieweds/try-latest-versionPlease try to reproduce the potential issue on the latest public versions/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions