Xojo Conferences
XDCMay2019MiamiUSA

[MBS] Retina CustumNSViewMBS (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] WebStarterKit repeated "UnhandledException: NilObjectException" error
Next thread: [MBS] [ANN] MonkeyBread Software Releases the MBS Real Studio plug-ins in version 13.1


Re: [MBS] Popupmenu   -   Garth Hjelte
  [MBS] Retina CustumNSViewMBS   -   Jaap Cammeraat
   Re: [MBS] Retina CustumNSViewMBS   -   Beatrix Willius
    Re: [MBS] Retina CustumNSViewMBS   -   Jaap Cammeraat
   Re: [MBS] Retina CustumNSViewMBS   -   Jaap Cammeraat
   Re: [MBS] Retina CustumNSViewMBS   -   Christian Schmitz
    Re: [MBS] Retina CustumNSViewMBS   -   Jaap Cammeraat

[MBS] Retina CustumNSViewMBS
Date: 09.05.13 11:55 (Thu, 9 May 2013 12:55:04 +0200)
From: Jaap Cammeraat
Hi Christian,

I'm converting some off my apps and don't find the way how to do something.

I have a NSWindowMBS with a CustumNSViewMBS.
The CustumNSViewMBS.DrawRect event has to draw the self created windowbackground with my own curved edges.

CustumNSViewMBS.DrawRect:
dim sf as double = mywindow.backingScaleFactor
g.shouldAntiAlias=True
g.drawAtPoint mywindowbackground(width/sf, height/sf), 0, 0, 0, 0, width*sf, height*sf, g.NSCompositeCopy, 1.0

The "mywindowbackground" method is returning a with .backingScaleFactor sized NSImageMBS.

Somewhere I made a mistake but where :-) ?


Regards,
Jaap Cammeraat

http://xinfinite.nl

Made by Xinfinite
Peks https://itunes.apple.com/app/peks/id554593512?mt=12&ls=1
iSticky https://itunes.apple.com/app/isticky/id409074222?mt=12&ls=1
•••



_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Retina CustumNSViewMBS
Date: 09.05.13 14:52 (Thu, 9 May 2013 15:52:29 +0200)
From: Beatrix Willius
Can you post some more of your code?

For retina you almost always have to stuff a 200x200 picture into a 100x100 one.

On 09.05.2013, at 15:46, Jaap Cammeraat <<email address removed>> wrote:

> I don't get it :-(
>
> When I use NSWindowMBS with a CustomNSViewMBS and want to draw a complete round window...
> How do I find it's graphic context to draw that round window without using any Picture classes?

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Retina CustumNSViewMBS
Date: 09.05.13 15:15 (Thu, 9 May 2013 16:15:32 +0200)
From: Jaap Cammeraat
Oops! I found a way :-)

I draw my special window like before but ofcourse double sized.

Then I'm using:

dim img as new NSImageMBS(p, p.Mask)
return img.imageByScalingToSize(width, height)

This returned img is used as the way I did before!

Thanks Christian and Beatrix

Regards,
Jaap Cammeraat

http://xinfinite.nl

Made by Xinfinite
Peks https://itunes.apple.com/app/peks/id554593512?mt=12&ls=1
iSticky https://itunes.apple.com/app/isticky/id409074222?mt=12&ls=1
•••



Op 9 mei 2013, om 15:52 heeft Beatrix Willius <<email address removed>> het volgende geschreven:

> Can you post some more of your code?
>
> For retina you almost always have to stuff a 200x200 picture into a 100x100 one.
>
> On 09.05.2013, at 15:46, Jaap Cammeraat <<email address removed>> wrote:
>
>> I don't get it :-(
>>
>> When I use NSWindowMBS with a CustomNSViewMBS and want to draw a complete round window...
>> How do I find it's graphic context to draw that round window without using any Picture classes?
>
> Mit freundlichen Grüßen/Regards
>
> Trixi Willius
>
> http://www.mothsoftware.com
> Mail Archiver X: The email archiving solution for professionals
>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> <email address removed>
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Retina CustumNSViewMBS
Date: 09.05.13 12:43 (Thu, 9 May 2013 13:43:02 +0200)
From: Jaap Cammeraat
That didn't help!

I think I have to create my background directly in a NSImage.
At this moment I'm drawing in a double sized RB Picture and creating a new NSImageMBS(p, p.Mask).
Everything of the windowbackground is using double pixels.



Op 9 mei 2013, om 12:59 heeft Christian Schmitz <<email address removed>> het volgende geschreven:

>
> Am 09.05.2013 um 12:55 schrieb Jaap Cammeraat <<email address removed>>:
>
>> Hi Christian,
>>
>> I'm converting some off my apps and don't find the way how to do something.
>>
>> I have a NSWindowMBS with a CustumNSViewMBS.
>> The CustumNSViewMBS.DrawRect event has to draw the self created windowbackground with my own curved edges.
>>
>> CustumNSViewMBS.DrawRect:
>> dim sf as double = mywindow.backingScaleFactor
>> g.shouldAntiAlias=True
>> g.drawAtPoint mywindowbackground(width/sf, height/sf), 0, 0, 0, 0, width*sf, height*sf, g.NSCompositeCopy, 1.0
>
> Well, I think the drawing function here expects the normal coordinates in points, not pixel.
>
> So you should have a double resolution image and draw it at normal coordinates.
>
> Like view is 100x100. Image is 200x200. And you draw
>
> g.drawAtPoint mywindowbackground(width*sf, height*sf), 0, 0, 0, 0, width, height, g.NSCompositeCopy, 1.0
>
> Greetings
> Christian

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Retina CustumNSViewMBS
Date: 09.05.13 11:59 (Thu, 9 May 2013 12:59:29 +0200)
From: Christian Schmitz

Am 09.05.2013 um 12:55 schrieb Jaap Cammeraat <<email address removed>>:

> Hi Christian,
>
> I'm converting some off my apps and don't find the way how to do something.
>
> I have a NSWindowMBS with a CustumNSViewMBS.
> The CustumNSViewMBS.DrawRect event has to draw the self created windowbackground with my own curved edges.
>
> CustumNSViewMBS.DrawRect:
> dim sf as double = mywindow.backingScaleFactor
> g.shouldAntiAlias=True
> g.drawAtPoint mywindowbackground(width/sf, height/sf), 0, 0, 0, 0, width*sf, height*sf, g.NSCompositeCopy, 1.0

Well, I think the drawing function here expects the normal coordinates in points, not pixel.

So you should have a double resolution image and draw it at normal coordinates.

Like view is 100x100. Image is 200x200. And you draw

g.drawAtPoint mywindowbackground(width*sf, height*sf), 0, 0, 0, 0, width, height, g.NSCompositeCopy, 1.0

Greetings
Christian

Re: [MBS] Retina CustumNSViewMBS
Date: 09.05.13 14:46 (Thu, 9 May 2013 15:46:13 +0200)
From: Jaap Cammeraat
I don't get it :-(

When I use NSWindowMBS with a CustomNSViewMBS and want to draw a complete round window...
How do I find it's graphic context to draw that round window without using any Picture classes?

•••



Op 9 mei 2013, om 12:59 heeft Christian Schmitz <<email address removed>> het volgende geschreven:

>
>
> Well, I think the drawing function here expects the normal coordinates in points, not pixel.
>
> So you should have a double resolution image and draw it at normal coordinates.
>
> Like view is 100x100. Image is 200x200. And you draw
>
> g.drawAtPoint mywindowbackground(width*sf, height*sf), 0, 0, 0, 0, width, height, g.NSCompositeCopy, 1.0
>
>
> Greetings
> Christian
>
> --
> Read our blog about news on our plugins:
>
> http://www.mbsplugins.de/
>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> <email address removed>
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info