Calculating tiles to display in a MapRect when “over-zoomed” beyond the overlay tile set

Imagine that the overlay is cloud cover – or in our case, cellular signal coverage. It might not “look good” while zoomed in deep, but the overlay is still conveying essential information to the user. I’ve worked around the problem by adding an OverZoom mode to enhance Apple’s TileMap sample code. Here is the new … Read more

Hook/Overlay a DirectX game?

You can try my example on hooking the Direct3D 9 API using C#. This utilizes EasyHook an open source .NET assembly that allows you to install hooks from managed code into unmanaged functions. SlimDX is also used – this is an open source managed wrapper around the Direct3D libraries. The tricky part of the hooking … Read more

jqGrid trigger “Loading…” overlay

If you are searching for something like DisplayLoadingMessage() function. It does not exist in jqGrid. You can only set the loadui option of jqGrid to enable (default), disable or block. I personally prefer block. (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options). But I think it is not what you wanted. The only thing which you can do, if you like … Read more

How to create a completely custom Dialogue/Popup in Android (change overlay colour and dialogue window layout)

I’ve solved this problem and created my own custom popup overlay with a custom coloured semi-transparent overlay background using the following steps: 1 – Create a new xml file in your res/values/ folder and name it styles.xml 2 – Here is where you will define your dialog properties. Here is what mine looks like. If … Read more

How do you directly overlay a scatter plot on top of a jpg image in matplotlib / Python?

The pyplot.scatter() function was tailor made for this reason: import matplotlib.pyplot as plt im = plt.imread(image_name) implot = plt.imshow(im) # put a blue dot at (10, 20) plt.scatter([10], [20]) # put a red dot, size 40, at 2 locations: plt.scatter(x=[30, 40], y=[50, 60], c=”r”, s=40) plt.show() See the documentation for more info.

Java: How to draw non-scrolling overlay over ScrollPane Viewport?

Ordinarily, “Swing programs should override paintComponent() instead of overriding paint(),” as mentioned in Painting in AWT and Swing: The Paint Methods. Based on ScrollPanePaint, which draws below the scrolling content, the following example overrides paint() to draw above the scrolling content. import java.awt.*; import javax.swing.*; /** * @see https://stackoverflow.com/a/10097538/230513 * @see https://stackoverflow.com/a/2846497/230513 * @see https://stackoverflow.com/a/3518047/230513 … Read more

How do I show text in android system status bar

I do found a solution, the keyword is overlay with a floating window. int statusBarHeight = 0; int resourceId = getResources().getIdentifier(“status_bar_height”, “dimen”, “android”); if (resourceId > 0) statusBarHeight = getResources().getDimensionPixelSize(resourceId); final WindowManager.LayoutParams parameters = new WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_CONTENT, statusBarHeight, WindowManager.LayoutParams.TYPE_SYSTEM_ERROR, // Allows the view to be on top of the StatusBar WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, // Keeps … Read more