# Canvas & Ionic - how to solve an issue

**URL:** <https://forum.ionicframework.com/t/canvas-ionic-how-to-solve-an-issue/118821>\
**Category:** ionic-v3\
**Created:** [January 19, 2018, 11:40pm UTC](https://forum.ionicframework.com/t/canvas-ionic-how-to-solve-an-issue/118821 "2018-01-19T23:40:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralexlife](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@ralexlife](https://forum.ionicframework.com/u/ralexlife)\
**Post date:** [January 19, 2018, 11:40pm UTC](https://forum.ionicframework.com/t/canvas-ionic-how-to-solve-an-issue/118821/1 "2018-01-19T23:40:27Z")

</div>

Hey guys,

I have an ionic app, similar to snapchat, where users can take a pic (using ionic native camera), add text, draw smth over, add icons / images etc.

This is implemented with a help of canvas. The width and height of canvas are set to this.platform.width() / height().

The workflow is the following:

1. User takes a pic
2. Pic is resized using canvas
3. Pic is placed on new canvas as a background property

If I do not resize the pic and place it as a background, only part of the pic is shown on the screen.  
If I resize a pic and make the size equal to canvas’ size, then the quality of the pic is really bad (blurred).

I do not know why I am not able to set any kind of background-size: cover properties to canvas to shrink the background pic, it simply doesn’t work.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [January 19, 2018, 11:50pm UTC](https://forum.ionicframework.com/t/canvas-ionic-how-to-solve-an-issue/118821/2 "2018-01-19T23:50:19Z")

</div>

ng2-img-tools is your friend.

---

<div class="post-metadata">

**Author:** ![ralexlife](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@ralexlife](https://forum.ionicframework.com/u/ralexlife)\
**Post date:** [January 19, 2018, 11:56pm UTC](https://forum.ionicframework.com/t/canvas-ionic-how-to-solve-an-issue/118821/3 "2018-01-19T23:56:04Z")

</div>

> [@AaronSterling](#):
>
> ng2-img-tools

Thank you!  
But why if I call this.platform.width, it gives me 360, but not 1440 as my screen resolution (Samsung Galaxy S6 Edge)?

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [January 20, 2018, 1:58am UTC](https://forum.ionicframework.com/t/canvas-ionic-how-to-solve-an-issue/118821/4 "2018-01-20T01:58:54Z")

</div>

That’s the resolution your browser is emulating. Standard with all densely packed pixel devices, pretty much every phone and tablet since 2013.

[https://www.html5rocks.com/en/tutorials/canvas/hidpi/](https://www.html5rocks.com/en/tutorials/canvas/hidpi/)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:54pm UTC](https://forum.ionicframework.com/t/canvas-ionic-how-to-solve-an-issue/118821/5 "2021-07-19T21:54:20Z")

</div>

Closed on July 19, 2021, 9:54pm UTC


