
البرمجة باستخدام الرسم
تقريباً بعد التحليل لمدة ساعة و نصف كأني فهمت :
هو اختار ألوان معينة ، قيمتها عند عرضها بالأسكي ، تتحول إلى حروف تحت ظروف مناسبة >> ! ، تستطيع تعمل العكس ، تكتب Hello Word ، تحولها إلى الست-عشري ، ستستنتج الألوان اللازمة ؟ مجرد تخمين .
تطبيق طمأنينة ، نسخة بيتا على أندرويد
عبدالله الشمّري - Al-Shammari
twitter @abshammeri
abshammeri AT gmail.com
github : abshammeri
بـلـبل كتب::)
a b c d e f g h i j k l m n o p q r s t u v w x y z 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
طبعا الحروف بشكل كبير
هههههههه
جميلة يا بلبل
You Are Welcome
يبدو انني حللت بعض من الموضوع
اقتباسThe term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped array of bits
بما اننا نعرف ان كل بكسل Pixel مخزن من بداية الصورة (النقطة 0،0 - الزاوية الشمال العلية -)
على هيئة bit array اي متتاليين
اقتباسIn typical uncompressed bitmaps, image pixels are generally stored with a color depth of 1, 4, 8, 16, 24, 32, 48, or 64 bits per pixel
و الصيغة المستخدمة ب MS Paint هي 24bit
(RGBA) و كل Pixel يتمثل ب 4Byte يبدو انه يستخدم 3 بايت فقط RGB
و الاحرف الانجليزية تستخدم 1Byte لكل حرف
---
لذلك لكتابة مثلا حرف Z
يجب ان يكون اللون (90,0,0,0)
0,0,90 حيث الارفام تكون مقلوبة BGR
لكن الغريب ان MS Paint لا يوجد به تحكم بدرجة Alpha لوضعها لقيمة صفر (لنتجاهلها حاليا)
لذلك عند استخدام البرنامج اختر قيمة اللون 90,0,0
و احفظ الصورة
ستجد حرف Z
مما نستدل
انه لكتابة ABC
يجب ان يكون اللون
65,66,67
76,66,65
طبعا في 1 Pixel
تحياتي
تم تعديل هذه المشاركة بواسطة .S.T.A.L.K.E.R في 17 يناير 2012 في 03:41
صنعت كود لتحويل النص الى صورة
اتمنى ان تستفيدو منه
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
/**
*
* @author MErsan
*/
public class BitmapToText {
static final int BITMAP_SMALLEST_SIZE = 56;//Calculated using 1*1 pixels image
public static void main(String[] args) throws IOException {
String text = "hello every one\n my name is Mosh Ersan";
text = text.toUpperCase();
byte[] textData = text.getBytes();
int dataLen = textData.length;
int pixels = dataLen / 3;
pixels += (dataLen % 3);
int bitmapWidth = (int) Math.sqrt(pixels);
int bitmapHeight = bitmapWidth;
int dataSize = (bitmapHeight * bitmapWidth);
byte[] initialData = new byte[54];
Arrays.fill(initialData, (byte) 0);
byte[] endData = new byte[2];
Arrays.fill(endData, (byte) 0);
initialData[0] = (byte) 66;//Deafult Values
initialData[1] = (byte) 77;//Deafult Values
initialData[2] = (byte) (BITMAP_SMALLEST_SIZE + dataSize); //File Size in Bytes
initialData[10] = (byte) 54;//Points to Pixels Array
initialData[14] = (byte) 40;// I Don't
initialData[18] = (byte) bitmapWidth;//Bitmap Width
initialData[22] = (byte) bitmapHeight;//Bitmap Height
initialData[26] = (byte) 1;// :S
initialData[28] = (byte) 24;//Color Depth
initialData[34] = (byte) 8; // And this :D
File f = new File("D://test.bmp");
if (!f.exists()) {
f.createNewFile();
}
FileOutputStream fos = new FileOutputStream(f);
fos.write(initialData);
fos.write(textData);
fos.write(endData);
fos.close();
}
}تم تعديل هذه المشاركة بواسطة .S.T.A.L.K.E.R في 17 يناير 2012 في 13:17
هذي يسمونها لغات البرمجة الاستهبالية
http://en.wikipedia.org/wiki/Esoteric_programming_language
بعض الأمثلة المشهورة
Whitespace programming language
البرمجة باستخدام المسافات
تبرمج باستخدام التاب والسبيس فقط
http://en.wikipedia.org/wiki/Whitespace_(programming_language)
http://compsoc.dur.ac.uk/whitespace/
مثال آخر على لغة اعتباطية
تم تعديل هذه المشاركة بواسطة بـارع في 17 يناير 2012 في 17:06


