# Xojo Listbox Retina

**URL:** <https://forum.xojo.com/t/xojo-listbox-retina/25641>\
**Category:** General\
**Created:** [July 22, 2015, 1:08pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641 "2015-07-22T13:08:34Z")\
**Posts on this page:** 10\
**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:** [July 22, 2015, 1:08pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/1 "2015-07-22T13:08:34Z")

</div>

Hi everyone,

I know there are limitations for doing retina enabled images in the listbox as I read many previous posts. I have tried using my retinakit2 the way Sam had recommended and my images are not retina compared to the other retina images in my app.

Has anyone succeeded achieving retina images in the celltextpaint?

Thank you  
Mike

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [July 22, 2015, 1:52pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/2 "2015-07-22T13:52:07Z")

</div>

Looking at my app-under-development: I am definitely seeing Retina images using CellTextPaint by simply creating an image that’s 2x the size of the graphics to be drawn into. I’m not seeing it using CellBackgroundPaint but that may simply be a coding error on my end.

---

<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:** [July 22, 2015, 2:03pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/3 "2015-07-22T14:03:20Z")

</div>

> [@201892:@Michael Diehr](#):
>
> Looking at my app-under-development: I am definitely seeing Retina images using CellTextPaint by simply creating an image that’s 2x the size of the graphics to be drawn into. I’m not seeing it using CellBackgroundPaint but that may simply be a coding error on my end.

Michael are you using RetinaKit or declares?

thanks!

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [July 22, 2015, 3:17pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/4 "2015-07-22T15:17:22Z")

</div>

Declares.

```auto
Declare Function BackingScaleFactor lib "AppKit" Selector "backingScaleFactor" (target As WindowPtr) As Double
```

and then setting “NSHighResolutionCapable” to True in the plist.

you then use the backingScaleFactor to make sure you are preparing your images at the 1x or 2x size as needed. You also have to make sure when you are drawing a picture, you don’t just use “graphics.drawPicture p,x,y” but rather the version with all the size parameters to stretch the 2x image down to the 1x canvas, e.g. “graphics.drawPicture p,x,y,w,h,0,0,p.width,p.height”

---

<div class="post-metadata">

**Author:** ![Merv\_Pate](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/76d3ee/32.png) [@Merv\_Pate](https://forum.xojo.com/u/Merv_Pate)\
**Post date:** [July 22, 2015, 5:19pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/5 "2015-07-22T17:19:12Z")

</div>

Yes, works fine for me as well. For a 16x16 image this is what it would look like. I hard-coded the numbers so that you can see it easily, but in my code it is calculated:

```auto
#If IsRetina then
    g.DrawPicture(MyPic2X, 0, 0, 16, 16, 0, 0, 32, 32)
#Else
    g.DrawPicture(MyPic, 0, 0, 16, 16)
#Endif
```

FYI, I was doing this in the CellBackgroundPaint event, but I works in the CellTextPaint event as well.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [July 23, 2015, 2:38am UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/6 "2015-07-23T02:38:25Z")

</div>

on the RKPicture object, there is a property called “drawingMode”

When drawing Retina images in a listbox, you need to set the following code.

```auto
image.drawingMode = image.kDrawingModeXojo
```

Then the retina image _should_ draw correctly in a listbox.

---

<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:** [July 30, 2015, 4:13pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/7 "2015-07-30T16:13:25Z")

</div>

Sam,

I apologize, but I never did replace my RetinaKit 1 w/ 2 since I originally had some MacOSLib conflicts I didn’t want to deal with at the time 🙂

I just implemented RetinaKit2 and fixed the MacOSLib conflicts and with your above code this works flawlessly under a listbox.

```auto
    Dim ciscologo_retina as RKPicture = retinaKit.imageNamed( "ciscoLogo" )
    ciscologo_retina.drawingMode = ciscologo_retina.kDrawingModeXojo
    g.DrawPicture(ciscologo_retina,0,2,ciscologo_retina.width,ciscologo_retina.height)
```

Thank you again Sam and once again Retinakit2 is worth its weight in gold for me.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [July 31, 2015, 2:47am UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/8 "2015-07-31T02:47:01Z")

</div>

> [@203499:@Mike Cotrone](#):
>
> Thank you again Sam and once again Retinakit2 is worth its weight in gold for me.

Your welcome, and I appreciate the compliment… Except that the RetinaKit being digital weighs so little, that it wouldn’t have any value in gold… 😉

---

<div class="post-metadata">

**Author:** ![Dodo\_Hunziker](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/8491ac/32.png) [@Dodo\_Hunziker](https://forum.xojo.com/u/Dodo_Hunziker)\
**Post date:** [February 26, 2016, 9:23am UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/9 "2016-02-26T09:23:43Z")

</div>

Everyone is talking images when it comes to retina displays. But what about the text? My text looks really blurry, even when I use retinizer or project10606 “Enable retina”. How to make use of the crisp fonts?

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:51pm UTC](https://forum.xojo.com/t/xojo-listbox-retina/25641/10 "2020-10-29T17:51:34Z")

</div>


