<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Retina &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/retina/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 02 Mar 2021 17:47:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Speeding up the Layout Editor</title>
		<link>https://blog.xojo.com/2019/04/09/speeding-up-the-layout-editor/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 13:00:31 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Layout Editor]]></category>
		<category><![CDATA[macOS]]></category>
		<category><![CDATA[Retina]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=5612</guid>

					<description><![CDATA[Travis decided to dive into the Layout Editor code and see what could be done to speed it up. The results are pretty remarkable. The difference is greatest for layouts with a lot of controls.]]></description>
										<content:encoded><![CDATA[<p>For more years than I&#8217;d like to admit, the Layout Editor has been slow in terms of dragging controls around. As you add more controls, it gets worse. For web layouts, it&#8217;s been even worse. That&#8217;s primarily because we have to draw everything for a web layout whereas for a desktop layout, the OS draws the controls for us.</p>
<p>In an engineering meeting, I mentioned a discussion I had with a user about the speed of the Layout Editor and Travis said he had recently been reminded of how slow it was too. While most of the time issues in Xojo are carefully calculated and prioritized for maximum bang for the buck (as we say around here), that&#8217;s not always how it happens. After the meeting, Travis decided to dive into the Layout Editor code and see what could be done to speed it up.</p>
<p>The results are pretty remarkable.</p>
<p><span id="more-5612"></span></p>
<p>The video below tells the story best.</p>
<div style="width: 1280px;" class="wp-video"><video class="wp-video-shortcode" id="video-5612-1" width="1280" height="720" preload="metadata" controls="controls"><source type="video/mp4" src="https://blog.xojo.com/wp-content/uploads/2019/04/Speeding-Up-the-Layout-Editor2.mp4?_=1" /><a href="https://blog.xojo.com/wp-content/uploads/2019/04/Speeding-Up-the-Layout-Editor2.mp4">https://blog.xojo.com/wp-content/uploads/2019/04/Speeding-Up-the-Layout-Editor2.mp4</a></video></div>
<p>The difference is greatest for layouts with a lot of controls.</p>
<p>To optimize for speed, we made two changes:</p>
<ol>
<li>On all platforms, selecting and dragging controls now only re-renders those controls that are selected. A buffered image (picture) is taken with everything but the selected controls, and thus only the selected controls have to be drawn on top of that as they move. This is an improvement from before, where every control was re-rendered in every frame whether it was moving or not.</li>
<li>The second optimization is Mac-specific. Some controls take a long time for macOS to draw and composite. In particular, controls like Group Boxes in Dark Mode can take a while. We now keep a cached copy of the rendered control from the operating system, and use that unless its size or properties change. That way, we don&#8217;t need to wait for macOS to draw the control every time we want to display or move it on the screen.</li>
</ol>
<p>If you have layouts with lots of controls, check out 2019r1. You&#8217;re in for a pleasant surprise.</p>
]]></content:encoded>
					
		
		<enclosure url="https://blog.xojo.com/wp-content/uploads/2019/04/Speeding-Up-the-Layout-Editor2.mp4" length="1737604" type="video/mp4" />

			</item>
		<item>
		<title>Xojo Community Growth in 2016</title>
		<link>https://blog.xojo.com/2017/01/05/xojo-community-growth-in-2016/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Thu, 05 Jan 2017 17:33:50 +0000</pubDate>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[XDC]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[HiDPi]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Retina]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=2137</guid>

					<description><![CDATA[As you may already know, 2016 was Xojo's 20 Anniversary. I take great pride in the fact that we have created something that has that kind of staying power. In 2016 we took many big steps forward with Xojo including HiDPI support for macOS (Retina), Windows and the web, hardware-acellerated graphics for Windows, tons of new iOS features, IDE improvements and compiler optimization for 64-bit builds. From everyone here at Xojo, Happy New Year!]]></description>
										<content:encoded><![CDATA[<p>As you may already know, 2016 was Xojo&#8217;s 20 Anniversary. Sitting down to write this post, I can&#8217;t help but think back to 20 years ago and starting what has now become Xojo. Most of the developer tools that were around when we started either no longer exist or are no longer published by the people who had the original vision to create them in the first place. In that respect, we are members of a very exclusive club. I&#8217;m also pleasantly surprised at how many users from way back then are actively using Xojo today. I take great pride in the fact that we have created something that has that kind of staying power.</p>
<p><span id="more-2137"></span></p>
<figure id="attachment_2138" aria-describedby="caption-attachment-2138" style="width: 1010px" class="wp-caption aligncenter"><img fetchpriority="high" decoding="async" class="wp-image-2138 size-full" src="https://blog.xojo.com/wp-content/uploads/2016/12/Anniversary-Shirt.png" alt="anniversary-shirt" width="1010" height="732" /><figcaption id="caption-attachment-2138" class="wp-caption-text">Email hello@xojo.com to order yours!</figcaption></figure>
<p>In 2016 we took many big steps forward with Xojo including HiDPI support for macOS (Retina), Windows and the web, hardware-acellerated graphics for Windows, tons of new iOS features, IDE improvements and compiler optimization for 64-bit builds. Check out the <a href="http://developer.xojo.com/2016-release-highlights">2016 Release Highlights</a>. The Xojo Forum has grown to over 16,000 members. We published our 100th video in the <a href="https://www.youtube.com/c/xojoinc">Xojo YouTube Channel</a> and added new playlists for <a href="https://www.youtube.com/playlist?list=PLPoq910Q9jXi_p96LT5k4BPwBlmH1HytK">Raspberry Pi</a> and <a href="https://www.youtube.com/playlist?list=PLPoq910Q9jXiH5A32myqHwd1WLuUnBTuO">Web Services</a> and more new videos in our <a href="https://www.youtube.com/playlist?list=PLPoq910Q9jXiePe2EYqV1J4whLP9O9vHQ">Spanish</a>, <a href="https://www.youtube.com/playlist?list=PLPoq910Q9jXjoTYaHQeFRKpk1p7qKbwCd">Italian</a> and <a href="https://www.youtube.com/playlist?list=PLPoq910Q9jXiYHemQHGYv3CO7vQWYt7Gz">German</a> language playlists.</p>
<p>We hosted another highly successful<a href="http://blog.xojo.com/2016/10/11/xdc-2016-recap/"> Xojo Developer Conference</a> in Houston, Texas and we&#8217;ll have an announcement soon about the next XDC. 2016 was another great year for Xojo and 2017 is looking even better! One of my favorite things is hearing about all the cool projects our users create and I have no doubt that there will be many more this year.</p>
<p>From everyone here at Xojo, Happy New Year!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Web Framework Changes in 2016r2</title>
		<link>https://blog.xojo.com/2016/07/20/web-framework-changes-in-2016r2/</link>
		
		<dc:creator><![CDATA[Greg O'Lone]]></dc:creator>
		<pubDate>Wed, 20 Jul 2016 07:03:46 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[HiDPi]]></category>
		<category><![CDATA[Retina]]></category>
		<category><![CDATA[Xojo Framework]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=1085</guid>

					<description><![CDATA[The web framework got some love in Xojo 2016r2&#8230; General Changes First, the Web Framework now has support for Retina/HiDPI in supported browsers. All controls&#8230;]]></description>
										<content:encoded><![CDATA[<p>The web framework got some love in Xojo 2016r2&#8230;</p>
<h2>General Changes</h2>
<p>First, the Web Framework now has support for Retina/HiDPI in supported browsers. All controls have been updated with new graphics to allow your Web Apps to look great on any screen. All you have to do is just flip the &#8220;Supports Retina/HiDPI&#8221; switch and start using Image objects instead of Pictures and you&#8217;re off and running!</p>
<p><em>NOTE: Regardless of whether you check the &#8220;Supports Retina/HiDPI&#8221; switch, the web framework now stores all of your image assets in the Resources directory next to your app and they are only loaded momentarily when a browser requests one. This means that your app should use a lot less memory overall.</em></p>
<p><strong>Controls</strong></p>
<p>WebCanvas: HiDPI/Retina drawing out of the box! No code change required!</p>
<p>WebPicture: Just start using Images instead of Pictures and flip the Retina/HiDPI switch and the web framework will automatically send the correct resolution image to the browser.</p>
<p>WebImageView: Because it&#8217;s backed with a WebPicture, it just works!</p>
<p>WebToolbar: Toolbar icons now support Images as well.</p>
<p><strong>Events</strong></p>
<p>WebSession.ScaleFactorChanged: Fires whenever the ScaleFactor of the current session&#8217;s browser changes.</p>
<p><strong>Properties</strong></p>
<p>WebSession.ScaleFactor (Read-Only): Reflects the current ScaleFactor of the browser.</p>
<h2>WebSDK</h2>
<p>The WebSDK has been given a ScaleFactorChanged event so your control is notified when a change occurs instead of your control needing to periodically check the ScaleFactor property on the Session object.</p>
<p>WebControlWrapper.ScaleFactorChanged: Fires whenever the ScaleFactor of the current session&#8217;s browser changes.</p>
<p>Also for WebSDK, we are now enforcing unique Javascript Namespaces throughout a project at compile time. This means you&#8217;ll be able to tell ahead of time if your controls are missing a namespace or if you&#8217;ve inadvertently used the same exact namespace more than once!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Advanced Retina/HiDPI: BitmapForCaching and ScaleFactorChanged</title>
		<link>https://blog.xojo.com/2016/04/07/advanced-retinahidpi-bitmapforcaching-and-scalefactorchanged/</link>
					<comments>https://blog.xojo.com/2016/04/07/advanced-retinahidpi-bitmapforcaching-and-scalefactorchanged/#comments</comments>
		
		<dc:creator><![CDATA[Joe Ranieri]]></dc:creator>
		<pubDate>Thu, 07 Apr 2016 00:00:00 +0000</pubDate>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[HiDPi]]></category>
		<category><![CDATA[Retina]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2016/04/07/advanced-retinahidpi-bitmapforcaching-and-scalefactorchanged/</guid>

					<description><![CDATA[The most direct way to support HiDPI for custom controls is to draw into the Graphics object passed into the Paint event. But you can also BitmapForCaching and ScaleFactorChanged]]></description>
										<content:encoded><![CDATA[<p>The most direct way to support HiDPI* for custom controls is to draw into the Graphics object passed into the Paint event. That graphics object is already configured with the appropriate scale factor and double buffering- the entire control will be handled correctly by the framework if the DoubleBuffer property is set.</p>
<p><em>*As with other posts, we&#8217;ll use &#8220;HiDPI&#8221; to refer to both HiDPI on Windows and Retina on OS X.</em></p>
<p><span id="more-232"></span></p>
<p>If drawing directly into the Graphics object passed into the control&#8217;s Paint event isn&#8217;t feasible or you need to manage your own caching of costly drawing for some reason, the BitmapForCaching function can be used to create a mutable bitmap thatâs configured appropriately for using as a cache. This bitmap has some screen-specific properties, like the scale factor, and should be thrown away in the ScaleFactorChanged event. For example:</p>
<pre>Class Foo<br />
 Inherits Canvas</p>
<p> Sub Paint(g As Graphics) Handles Event<br />
  CreateCacheIfNeeded()<br />
  g.DrawPicture(mCachedContent, 0, 0)<br />
 End Sub</p>
<p> Sub ScaleFactorChanged() Handles Event<br />
  mCachedContent = Nil<br />
 End Sub</p>
<p> Private Sub CreateCacheIfNeeded()<br />
  If mCachedContent &lt;&gt; Nil Then Exit Sub</p>
<p>  // Pretend this is a costly operation<br />
  mCachedContent = Self.TrueWindow.BitmapForCaching(100, 100)<br />
  Dim g As Graphics = mCachedContent.Graphics<br />
  g.FillRect(0, 0, g.Width, g.Height)<br />
 End Sub</p>
<p> Private Dim mCachedContent As Picture<br />
End Class</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.xojo.com/2016/04/07/advanced-retinahidpi-bitmapforcaching-and-scalefactorchanged/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Xojo Retina/HiDPI: The journey of a thousand pixels&#8230;</title>
		<link>https://blog.xojo.com/2016/04/05/xojo-retinahidpi-the-journey-of-a-thousand-pixels/</link>
					<comments>https://blog.xojo.com/2016/04/05/xojo-retinahidpi-the-journey-of-a-thousand-pixels/#comments</comments>
		
		<dc:creator><![CDATA[Greg O'Lone]]></dc:creator>
		<pubDate>Tue, 05 Apr 2016 00:00:00 +0000</pubDate>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[HiDPi]]></category>
		<category><![CDATA[Retina]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2016/04/05/xojo-retinahidpi-the-journey-of-a-thousand-pixels/</guid>

					<description><![CDATA[Tips, Tricks and Code to help you build your first Retina / HiDPI apps with Xojo 2016r1.]]></description>
										<content:encoded><![CDATA[<p>&#8220;Retina&#8221; is the name for high resolution screens on Mac and iOS devices while &#8220;HiDPI&#8221; is the Windows equivalent. For simplicity, I&#8217;ll use HiDPI (which really is the universal technical term) for the rest of this blog post. Now that we have HiDPI support in Xojo, if you app doesn&#8217;t use any pictures, you can simply open your project, click on Shared under Build Settings and turn on the &#8220;Supports Retina/HiDPI&#8221; option. That&#8217;s all you need to do to have a HiDPI version of your app!</p>
<p>Having said that, if you are creating or using pictures in your project, there may be a few adjustments you&#8217;ll need to make to your code. A little over a year ago the process of making sure we had all of the necessary graphics together to build a Retina/HiDPI IDE was added to my to-do list. While 95% of the icons created for the Xojo IDE in 2013 already existed, most of the graphics that made up the IDE itself did not, and the IDE itself needed a bit of an overhaul to get it ready for the big change, both in graphics and in code&#8230;</p>
<p><span id="more-230"></span><span style="font-size: 18px;"><strong>Graphics</strong></span></p>
<p>Since the Xojo framework didn&#8217;t have any HiDPI support yet, everything done last year was done brute force, that is, 2x images were loaded, scaled down by 50% and drawn where they belonged, just to make sure things would mostly line up correctly. While doing this did reveal the amount of work that we were in for, it also hid some issues that we ran into when the HiDPI-enabled frameworks started coming available this spring.</p>
<p>To give you an idea of the size of the task, there are a little over 1000 distinct icons and images used in the IDE today, of which ~370 we did not have a HiDPI version. Now while I like using programs like PhotoshopÂ® or FireworksÂ® for doing work like this, I wanted to transition our graphics to a vector drawing tool so that if/when a higher resolution screen is available, we&#8217;ll be able to go back to the originals and start from resolution-independent source-material. That said, we settled on using Bohemian Coding&#8217;s <a href="http://www.sketchapp.com" target="_blank" rel="nofollow">Sketch</a> for the majority of the new graphics work. Total time to generate the missing images was about two man-months.</p>
<p><span style="font-size: 18px;"><strong>Code</strong></span></p>
<p>Once the HiDPI-enabled frameworks started coming together, every place where a picture was being drawn needed to be audited (see why in the next section). This work took us from mid-December all the way through mid-March. I won&#8217;t tell you that it took two of us three full months of 60 hour weeks to accomplish, <em>but it sure felt like it</em>.</p>
<p>A couple of legacy coding issues came to light which would have to be resolved for everything to work right and I wanted to go over them just in case your projects don&#8217;t render correctly right off the bat. Let&#8217;s look at what&#8217;s changed.</p>
<p><strong>Points vs. Pixels</strong></p>
<p>This is by far the most common issue you&#8217;ll probably run into. Before Xojo had HiDPI support, a single element of color on a Picture and a single element of color on a Graphics object were exactly the same thing, pixel for pixel.. If your code looked like this:</p>
<pre style="background-color: #ffffcc; padding: 10px;">Dim p As New Picture(100, 100)
Dim g as Graphics = p.Graphics
Dim widthPic as Integer = p.Width
Dim widthGraphics as Integer = g.Width</pre>
<p>both widthPic and widthGraphics would have values of 100.</p>
<p>Now with HiDPI turned on, Picture coordinates and Graphics coordinates <em>can be</em> different from one another if the scale factor of the screen is greater than one. If you were to change the code above to:</p>
<div style="background-color: #ffffcc; padding: 10px;">
<pre>Dim p As TrueWindow.BitmapForCaching(100, 100)
Dim g as Graphics = p.Graphics
Dim widthPic as Integer = p.Width
Dim widthGraphics as Integer = g.Width</pre>
<p><em><span style="font-size: 12px;">Note: The BitmapForCaching method creates an image that has the right number of pixels and the right scale factor so you can just draw to it the way you always have and have everything still work exactly the same.</span></em></p>
</div>
<p>The value of widthPic will differ depending on whether your application is running on a HiDPI screen or not:</p>
<table style="height: 80px; border: 1px solid black; margin-left: auto; margin-right: auto;" border="0" width="395">
<tbody>
<tr>
<td></td>
<td style="text-align: center;">widthPic</td>
<td style="text-align: center;">widthGraphics</td>
</tr>
<tr>
<td style="text-align: right;">Normal</td>
<td style="text-align: center;">100</td>
<td style="text-align: center;">100</td>
</tr>
<tr>
<td style="text-align: right;">HiDPI</td>
<td style="text-align: center;"><strong>200</strong></td>
<td style="text-align: center;">100</td>
</tr>
</tbody>
</table>
<p>&#8230;and this is where the trouble begins because the number of physical pixels has actually doubled (in both directions, by the way) while the width and height of the Graphics object still reflect the original dimensions. The difference between these values is the scale factor of the screen you are drawing to.</p>
<p>Now, if you consider that Picture.Width and Graphics.Width have been interchangeable until now, you can see that this can cause a bit of a problem. When drawing to the Graphics object, you need to be working in Graphics pixels, not Picture pixels:</p>
<pre style="background-color: #ffffcc; padding: 10px;">Dim p As TrueWindow.BitmapForCaching(100, 100)
Dim g as Graphics = p.Graphics
Dim widthPic as Integer = p.Width
Dim widthGraphics as Integer = g.Width
g.ForeColor = &amp;cFF0000
g.DrawOval(0, 0, g.Width, g.Height) // Correct
g.DrawOval(0, 0, p.Width, p.Height) // This will draw too large</pre>
<p>To wrap up this already long story, make sure all of your drawing routines are using coordinates relative to the Graphics object.</p>
<div style="background-color: #eee; padding: 10px;">If right about now you&#8217;re wondering what we were smoking when this decision was made, rest assured that it was discussed for a long time and the overwhelming driving force was to maintain backward compatibility. With things set up this way you can still draw it onto a Graphics object created with the HiDPI framework and it should just work!</div>
<p><strong>Immutable Pictures</strong></p>
<p>Another hurdle you&#8217;ll undoubtedly encounter is the fact that multiresolution images are not inherently editable. This allows the framework to be more intelligent about loading and unloading images at runtime. This affects Image objects created in the IDE as well as ones created in code using the new Picture Constructor API. The most obvious effect is that you can&#8217;t draw directly to these images any more and the Graphics and RGBSurface properties will be Nil. If you need the ability to draw onto a picture via its Graphics property, draw the image onto a Picture created in code and work from that &#8211; don&#8217;t forget to copy the scale properties!</p>
<p><strong>Nested Drawing</strong></p>
<p>If your application creates pictures, and draws other pictures and clips into it using several levels of nesting, make sure you start from the top level when refactoring your code. You&#8217;ll find any compounded scaling errors much earlier this way, but you&#8217;ll also run a much smaller risk of creating issues that will only manifest when you go back and fix the top level drawing routines.</p>
<p><strong>Drawing Without Context</strong></p>
<p>For most of you, your drawing code will be directly in the Paint event of a Canvas and the Graphics object passed to the event already has all of the information that you need to succeed. In addition, you can always get a mutable picture that is all set up for the current screen by calling the new Window.BitmapForCaching method. This method is available from any RectControl, Window or ContainerControl subclass using TrueWindow.BitmapForCaching.</p>
<p>If (for some reason) you don&#8217;t have access to a window from your code, you <em>can</em> create a HiDPI image from a Graphics context by using the new ScaleX and ScaleY properties to set things up. For consistency, we created an extends method in a module like this:</p>
<pre style="background-color: #ffffcc; padding: 10px;">Function BitmapForCaching(Extends g as Graphics, Width as Integer,  Height as Integer) As Picture
  Dim p as New Picture(Width * g.ScaleX, Height * g.ScaleY)
  // Set the appropriate resolution
  p.HorizontalResolution = 72 * g.ScaleX
  p.VerticalResolution = 72 * g.ScaleY

  // Set the scale factor so drawing to it will be correct
  p.Graphics.ScaleX = g.ScaleX
  p.Graphics.ScaleY = g.ScaleY

  // Very important to remember the mask!
  p.Mask.Graphics.ScaleX = g.ScaleX
  p.Mask.Graphics.ScaleY = g.ScaleY

  // Return the new picture
  Return p
End Function</pre>
<p>If neither a Window nor a Graphics context is available, you can always create a multi-representation picture and leave it up to the framework to choose the right one when the image is being drawn to a Window, like this:</p>
<pre style="background-color: #ffffcc; padding: 10px;">Dim pa() as Picture
Dim p1 as new Picture(100, 100)
p1.Graphics.DrawOval(0, 0, 100, 100)
pa.append p1

Dim p2 as New Picture(200, 200)
p2.Graphics.DrawOval(0, 0, 200, 200)
pa.append p2

Dim RetinaPicture as New Picture(100, 100, pa)</pre>
<p>You&#8217;ll have to draw everything twice, so I suggest caching these images so you don&#8217;t need to do this more than once, especially if your drawing code is complicated. You can use a similar technique to load images from disk:</p>
<pre style="background-color: #ffffcc; padding: 10px;">Dim pa() as Picture
Dim f as Folderitem = GetFolderItem("Test.png")
Dim pic as Picture = Picture.Open(f)
pa.append pic

f = GetFolderItem("Test@2x.png")
pic = Picture.Open(f)
pa.append pic

Dim RetinaPicture as New Picture(100, 100, pa)</pre>
<p>Just remember that the images passed into this form of the Picture.Constructor must all have exactly the same aspect ratio or the framework will throw an InvalidArgumentException!</p>
<p><span style="font-size: 18px;"><strong>Conclusion</strong></span></p>
<p>We&#8217;re looking forward to seeing all of your apps become HiDPI-aware and hearing about your experiences. I hope that our experience and suggestions make your transition just a little bit easier!<span id="hs-cta-wrapper-aeb03183-a469-4f96-9547-7dd75111c681" class="hs-cta-wrapper"><span id="hs-cta-aeb03183-a469-4f96-9547-7dd75111c681" class="hs-cta-node hs-cta-aeb03183-a469-4f96-9547-7dd75111c681"><a href="http://cta-redirect.hubspot.com/cta/redirect/608515/aeb03183-a469-4f96-9547-7dd75111c681" target="_blank"><br />
</a> </span><script src="https://js.hscta.net/cta/current.js" charset="utf-8">// <![CDATA[
<script type="text/javascript"><![CDATA[ hbspt.cta.load(608515, 'aeb03183-a469-4f96-9547-7dd75111c681', {}); // ]]&gt;</script></span></p>
<p>Read more: <a href="http://blog.xojo.com/2016/04/07/advanced-retinahidpi-bitmapforcaching-and-scalefactorchanged/">Advanced Retina/HiDPI: BitmapForCatching and ScaleFactorChanged</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.xojo.com/2016/04/05/xojo-retinahidpi-the-journey-of-a-thousand-pixels/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>O Retina, Retina, wherefore art thou Retina?</title>
		<link>https://blog.xojo.com/2015/12/08/o-retina-retina-wherefore-art-thou-retina/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Tue, 08 Dec 2015 00:00:00 +0000</pubDate>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[HiDPi]]></category>
		<category><![CDATA[Retina]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2015/12/08/o-retina-retina-wherefore-art-thou-retina/</guid>

					<description><![CDATA[Xoj is a cross-platform tool so we decided we should support both Retina and HiDPI, and do it in such a way that you don't have to do much of anything and they just work.]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" style="margin: 0px 10px 10px 0px; float: left; width: 320px;" title="eyeball.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/eyeball.pngt1466486449161ampwidth320" sizes="(max-width: 320px) 100vw, 320px" alt="eyeball.png" width="320" data-constrained="true" />During my keynote address last April at XDC, the Xojo Developer Conference, I said that we would be adding Retina support (the OS X feature that provides for ultra-high resolution displays) to the OS X framework in the 4th quarter of this year. We have been working very hard on Retina support both for the OS X framework and for the IDE itself. We didn&#8217;t want to stop there though. Windows also supports ultra-high resolution displays. For Windows, this technology is called HiDPI. Xojo is a cross-platform tool so we decided we should support both Retina and HiDPI, and do it in such a way that you don&#8217;t have to do much of anything and they just work.</p>
<p><a href="http://blog.xojo.com/2016/04/05/xojo-retinahidpi-the-journey-of-a-thousand-pixels/">UPDATE: Xojo Retina is here, April 2016</a></p>
<p><span id="more-306"></span></p>
<p>This bigger feature set of course takes a bit longer. We were hoping to ship it in 2015r4 this month but that&#8217;s not going to happen. There&#8217;s simply not enough time to test Retina/HiDPI support well enough to satisfy us. Instead, this feature along with a Retina/HiDPI-enabled Xojo IDE will come in 2016r1.</p>
<p>There will still be a 2015r4 release. We&#8217;ve been squashing bugs as we always do and we&#8217;ll get Xojo 2015r4 into your hands this month so you can have an even more robust base upon which to build your apps.</p>
<p>No one likes waiting, but the year is almost over and 2016r1 will be here before you can say Remote Debugger! OK, maybe not quite that fast but soon enough. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>From all of us at Xojo, Inc. we thank you for your continued support and we wish you and yours Happy Holidays.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
