# Canvas g.drawpicture looking weird under WIn7

**URL:** <https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683>\
**Category:** Windows\
**Created:** [March 1, 2014, 12:21am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683 "2014-03-01T00:21:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 12:21am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/1 "2014-03-01T00:21:28Z")

</div>

I have been developing primarily on Mac OS so this is my first with compiling on Windows. I have noticed that my canvas.paint’s drawpicture is looking funky 🙂

![](http://i59.tinypic.com/2evqfeq.png)

This works perfectly in OSX so I may be missing a Windows-esce tuning code.

Here is my code for the screen shot above.

Canvas.Paint

```auto
  g.PenHeight=1
  g.PenWidth=1
  g.ForeColor = &cFFFFFF
  g.FillRect(0,0,me.Width,me.Height)
  
  g.Transparency = 70
  g.ForeColor = &c000000
  g.DrawRect(-2,-1,me.Width+4,me.Height)
  g.Transparency = 0
  
  g.DrawPicture(ipsubnetting100x99,(Self.Width-ipsubnetting100x99.Width)/2,20)
  
```

Thank you in advance! 🙂

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 12:35am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/2 "2014-03-01T00:35:00Z")

</div>

OSX View of same code.

![](http://i61.tinypic.com/2elgsj5.png)

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [March 1, 2014, 12:40am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/3 "2014-03-01T00:40:08Z")

</div>

Looks kind of like the “compile on Mac, run on Windows” problem. Your images look perfect compiled on Windows. (I scraped them out of the sample you provided.)

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 12:44am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/4 "2014-03-01T00:44:23Z")

</div>

Well then 🙂 It must be a Virtual Box driver issue potentially then since my Win7 is a VM. Thanks!!

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 12:47am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/5 "2014-03-01T00:47:08Z")

</div>

I will also load Xojo within my Win VM just to ensure its not that problem 🙂 Thanks again.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 1:17am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/6 "2014-03-01T01:17:34Z")

</div>

Tim I have the same issue with compiling with Windows Xojo so it must be a Virtual Box issue. Can you verify that this looks proper if you have a minute?

Thanks!  
[https://www.dropbox.com/s/h68zhc70mo2n9v3/Windows.zip](https://www.dropbox.com/s/h68zhc70mo2n9v3/Windows.zip)

---

<div class="post-metadata">

**Author:** ![Eugene\_Dakin](https://forum.xojo.com/user_avatar/forum.xojo.com/eugene_dakin/32/178_2.png) [@Eugene\_Dakin](https://forum.xojo.com/u/Eugene_Dakin)\
**Post date:** [March 1, 2014, 1:35am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/7 "2014-03-01T01:35:30Z")

</div>

Hi Mike,  
It still looks like multiple images over top of each other as shown in your first post.

This is on an original Windows 8.1 Machine - no VM.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 1:37am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/8 "2014-03-01T01:37:48Z")

</div>

Weird. Thanks Eugene for checking.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 1:53am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/9 "2014-03-01T01:53:06Z")

</div>

IT has to be how I am saving my images. I just used the g.drawnoteicon and it worked fine under windows.

---

<div class="post-metadata">

**Author:** ![Eugene\_Dakin](https://forum.xojo.com/user_avatar/forum.xojo.com/eugene_dakin/32/178_2.png) [@Eugene\_Dakin](https://forum.xojo.com/u/Eugene_Dakin)\
**Post date:** [March 1, 2014, 2:04am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/10 "2014-03-01T02:04:48Z")

</div>

Hi Mike,

Just to test a theory, add a new canvas on the windows and draw a single photo to the canvas by placing the following code in the Paint event:

```auto
g.DrawPicture(Photo, 0,0, g.Width, g.Height, 0,0,Photo.Width, Photo. Height)
```

This works on my Windows 8.1 machine. I placed a png photo with a clear background (no colour) and added text to see if there would be multiple instances of the photograph. The simple Canvas worked as expected by showing one single photo with no overlap.

If this works on your machine then the code for drawing in the original canvas may be an issue. If you get the same result on the second Canvas, then it is likely a VM issue.

Just my $0.02 🙂

---

<div class="post-metadata">

**Author:** ![Eugene\_Dakin](https://forum.xojo.com/user_avatar/forum.xojo.com/eugene_dakin/32/178_2.png) [@Eugene\_Dakin](https://forum.xojo.com/u/Eugene_Dakin)\
**Post date:** [March 1, 2014, 2:06am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/11 "2014-03-01T02:06:36Z")

</div>

I can’t edit my previous post, and the Windows copy:paste issue happened again ☹ … there is an additional space between the last Photo. and Height… please remove the space

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 2:21am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/12 "2014-03-01T02:21:34Z")

</div>

Thanks Eugene I will try now.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 2:23am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/13 "2014-03-01T02:23:38Z")

</div>

Eugene yes I did happen with your idea above also. Must be a Virtual Box VM issue 🙂 Thanks again!

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [March 1, 2014, 2:27am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/14 "2014-03-01T02:27:19Z")

</div>

[quote=68636:@Mike Cotrone]Tim I have the same issue with compiling with Windows Xojo so it must be a Virtual Box issue. Can you verify that this looks proper if you have a minute?

Thanks!  
[https://www.dropbox.com/s/h68zhc70mo2n9v3/Windows.zip[/quote]](https://www.dropbox.com/s/h68zhc70mo2n9v3/Windows.zip%5B/quote%5D)  
The compiled exe demonstrates the same problem.

> [@68648:@Mike Cotrone](#):
>
> Eugene yes I did happen with your idea above also. Must be a Virtual Box VM issue 🙂 Thanks again!

So a simple image drawn in the canvas comes out wrong? Send me the image and I’ll try it on my machine. But it does sound like a mac → windows issue, even when run in a VM.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 2:28am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/15 "2014-03-01T02:28:21Z")

</div>

[https://www.dropbox.com/s/b72873p8on8wf9i/ipsubnetting48x48.png](https://www.dropbox.com/s/b72873p8on8wf9i/ipsubnetting48x48.png)

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [March 1, 2014, 2:33am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/16 "2014-03-01T02:33:47Z")

</div>

What sort of Mac do you have Mike ?  
There is a known issue compiling on Haswell based Macs for Windows where the OS routine we use does this screwy banding  
We filed a Radar with Apple about it but the temporary answer is to compile on the VM under Windows

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 2:34am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/17 "2014-03-01T02:34:42Z")

</div>

a new MBP 15" Retina. 2.3 Ghz Intel i7.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [March 1, 2014, 2:35am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/18 "2014-03-01T02:35:45Z")

</div>

Yeah  
Compile under a VM running Windows for now  
That banding is purely a bug in 10.9’s ImageIO BMP code

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [March 1, 2014, 2:37am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/19 "2014-03-01T02:37:57Z")

</div>

> [@68651:@Mike Cotrone](#):
>
> [Dropbox - Error - Simplify your life](https://www.dropbox.com/s/b72873p8on8wf9i/ipsubnetting48x48.png)

Looks great compiled on an actual windows 7 machine.

Did you compile it on the VM? Or just run it there?

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 1, 2014, 2:38am UTC](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683/20 "2014-03-01T02:38:42Z")

</div>

Tim Both. I ran it after compiling it on mac. AND I also compiled it on the VM itself with Xojo Windows … Both same results for me.

[Next page](https://forum.xojo.com/t/canvas-g-drawpicture-looking-weird-under-win7/14683.md?page=2)
