Creating image sets at run time

I am adapting several applications to Retina, everything is fine except Bevelbutton and Segmented controls are always displaying the biggest available icon in the IDE (ugly but workable). Another problem I have is when assigning a listbox rowpicture from a file during run time. There is no way to create an image set with the required sizes and let it work as with the picture that are available in the project. I am actually trying to add file icons, I have tried with MBS plugin and Retinakit but the result is always blurry compared to Finder icons. Thanks in advance :slight_smile:

For the list box and the retina kit, you need to manually draw the icons in the cellTextPaint event.

Converting a retina image to a Xojo picture rasterises it to a single image, which Xojo then displays as low resolution.

Hi Sam, do you have sample code I can try? I will buy your kit right away if it works :slight_smile:

There is a new Picture constructor that will create an Image from a set of bitmaps.

Below is a code snippet from the Retina Kit demo application.

[code] Dim p as RKPicture = me.rowTag( row )
if p <> nil then
if p.drawingMode = p.kdrawingModeNSImage then p.drawIngMode = p.kdrawingModeXojo

			Dim iconSize as integer = ( g.height-4 )
			Dim scale as double = iconSize / max( p.width, p.height )
			
			g.drawPicture p, x + ( iconSize - ( p.width * scale ) ) / 2, 2 + ( iconSize - ( p.height * scale ) ) / 2, p.width * scale, p.Height * scale
			
			x = x + g.height
			
			g.drawstring me.cell( row, column ), x, y
			
			return true
	end if[/code]