Skip to content

Instantly share code, notes, and snippets.

@soeminnminn
soeminnminn / DDSImageParser.cs
Last active November 18, 2023 16:39
Read DDS image in C# way. Converted from "[il_dds.c] https://github.com/DentonW/DevIL/blob/master/DevIL/src-IL/src/il_dds.c" (DevIL).
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
namespace S16.Drawing
{
#region DDSImage Class
@soeminnminn
soeminnminn / UITraceListener.cs
Last active August 29, 2015 14:02
UITraceListener
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
// Usage:
//public partial class MyForm : Form
//{
// private UITraceListener textboxTraceListener;
// public MyForm()
@soeminnminn
soeminnminn / CursorAdapter.java
Last active November 2, 2015 03:46
Android CursorAdapter with custom ID column name.
package com.s16.data;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.DataSetObserver;
import android.os.Handler;
import android.provider.BaseColumns;
import android.view.View;
import android.view.ViewGroup;
@soeminnminn
soeminnminn / JSONArrayAdapter.java
Created August 15, 2014 08:06
Android JSONArrayAdapter. Required gson library.
package com.s16.data;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
@soeminnminn
soeminnminn / AbstractDataProvider.java
Last active February 8, 2022 12:33
SQLite table warpper for android
package com.s16.data;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
@soeminnminn
soeminnminn / JSONArrayCursor.java
Created November 2, 2015 03:48
Android Cursor for JSONArray.
package com.s16.data;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@soeminnminn
soeminnminn / ScaleTypeDrawable.java
Created November 4, 2015 03:25
Android Drawable with scale type.
package com.s16.drawing;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.Context;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Security.Permissions;
namespace S16.IO
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Runtime.Serialization;
using System.Collections.Specialized;
namespace S16.Text
// ==========================================================
// TargaImage
//
// Design and implementation by
// - David Polomis (paloma_sw@cox.net)
//
//
// This source code, along with any associated files, is licensed under
// The Code Project Open License (CPOL) 1.02
// A copy of this license can be found in the CPOL.html file