Canvas drawImage method does not draw











up vote
1
down vote

favorite












I have an issue with drawImage function. when I invoke



    var paint = ui.Paint();
c.drawImage(backgroundImage, ui.Offset.zero, paint);


The image is drawn on emulator but on Huawei P20 it's not. When I run the app with



flutter run --enable-software-rendering


then the image is loaded but the UI is slow (I'm using photo_view to display the image and the dragging and zooming speed is unacceptable).



Is there any solution to this issue?










share|improve this question






















  • post full code to get help. This is quite hard like that
    – mcfly
    Nov 13 at 14:56










  • Image widget does work without that switch. I load asset resource. Regarding the code, please see this thread: stackoverflow.com/a/53217074/5492496 I'm using this very same code. What is more, the background image is not loaded when I draw it on the canvas, when I return it directly in MapRenderer.renderMap then everything is fine.
    – RMK
    Nov 14 at 8:50










  • As I described, everything works on emulator and on Huawei P20 with the flag. But does not without that flag so there must be some issue with rendering.
    – RMK
    Nov 15 at 9:06















up vote
1
down vote

favorite












I have an issue with drawImage function. when I invoke



    var paint = ui.Paint();
c.drawImage(backgroundImage, ui.Offset.zero, paint);


The image is drawn on emulator but on Huawei P20 it's not. When I run the app with



flutter run --enable-software-rendering


then the image is loaded but the UI is slow (I'm using photo_view to display the image and the dragging and zooming speed is unacceptable).



Is there any solution to this issue?










share|improve this question






















  • post full code to get help. This is quite hard like that
    – mcfly
    Nov 13 at 14:56










  • Image widget does work without that switch. I load asset resource. Regarding the code, please see this thread: stackoverflow.com/a/53217074/5492496 I'm using this very same code. What is more, the background image is not loaded when I draw it on the canvas, when I return it directly in MapRenderer.renderMap then everything is fine.
    – RMK
    Nov 14 at 8:50










  • As I described, everything works on emulator and on Huawei P20 with the flag. But does not without that flag so there must be some issue with rendering.
    – RMK
    Nov 15 at 9:06













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have an issue with drawImage function. when I invoke



    var paint = ui.Paint();
c.drawImage(backgroundImage, ui.Offset.zero, paint);


The image is drawn on emulator but on Huawei P20 it's not. When I run the app with



flutter run --enable-software-rendering


then the image is loaded but the UI is slow (I'm using photo_view to display the image and the dragging and zooming speed is unacceptable).



Is there any solution to this issue?










share|improve this question













I have an issue with drawImage function. when I invoke



    var paint = ui.Paint();
c.drawImage(backgroundImage, ui.Offset.zero, paint);


The image is drawn on emulator but on Huawei P20 it's not. When I run the app with



flutter run --enable-software-rendering


then the image is loaded but the UI is slow (I'm using photo_view to display the image and the dragging and zooming speed is unacceptable).



Is there any solution to this issue?







dart flutter






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 at 12:40









RMK

647510




647510












  • post full code to get help. This is quite hard like that
    – mcfly
    Nov 13 at 14:56










  • Image widget does work without that switch. I load asset resource. Regarding the code, please see this thread: stackoverflow.com/a/53217074/5492496 I'm using this very same code. What is more, the background image is not loaded when I draw it on the canvas, when I return it directly in MapRenderer.renderMap then everything is fine.
    – RMK
    Nov 14 at 8:50










  • As I described, everything works on emulator and on Huawei P20 with the flag. But does not without that flag so there must be some issue with rendering.
    – RMK
    Nov 15 at 9:06


















  • post full code to get help. This is quite hard like that
    – mcfly
    Nov 13 at 14:56










  • Image widget does work without that switch. I load asset resource. Regarding the code, please see this thread: stackoverflow.com/a/53217074/5492496 I'm using this very same code. What is more, the background image is not loaded when I draw it on the canvas, when I return it directly in MapRenderer.renderMap then everything is fine.
    – RMK
    Nov 14 at 8:50










  • As I described, everything works on emulator and on Huawei P20 with the flag. But does not without that flag so there must be some issue with rendering.
    – RMK
    Nov 15 at 9:06
















post full code to get help. This is quite hard like that
– mcfly
Nov 13 at 14:56




post full code to get help. This is quite hard like that
– mcfly
Nov 13 at 14:56












Image widget does work without that switch. I load asset resource. Regarding the code, please see this thread: stackoverflow.com/a/53217074/5492496 I'm using this very same code. What is more, the background image is not loaded when I draw it on the canvas, when I return it directly in MapRenderer.renderMap then everything is fine.
– RMK
Nov 14 at 8:50




Image widget does work without that switch. I load asset resource. Regarding the code, please see this thread: stackoverflow.com/a/53217074/5492496 I'm using this very same code. What is more, the background image is not loaded when I draw it on the canvas, when I return it directly in MapRenderer.renderMap then everything is fine.
– RMK
Nov 14 at 8:50












As I described, everything works on emulator and on Huawei P20 with the flag. But does not without that flag so there must be some issue with rendering.
– RMK
Nov 15 at 9:06




As I described, everything works on emulator and on Huawei P20 with the flag. But does not without that flag so there must be some issue with rendering.
– RMK
Nov 15 at 9:06

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53281216%2fcanvas-drawimage-method-does-not-draw%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53281216%2fcanvas-drawimage-method-does-not-draw%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?