DrawImage ImageAttributes OutOfMemoryException
You must keep the stream open for the lifetime of the Image.
Add comment May 7th, 2009
You must keep the stream open for the lifetime of the Image.
Add comment May 7th, 2009
unit Base64;
interface
uses EncdDecd,Graphics,Classes;
function BitmapToString(Bitmap:TBitmap):String;
function StringToBitmap(str:String):TBitmap;
implementation
function BitmapToString(Bitmap:TBitmap):String;
var
BitmapStream:TMemoryStream;
strStream:TStringStream;
begin
BitmapStream:=TMemoryStream.Create;
strStream:=TStringStream.Create('');
Bitmap.SaveToStream(BitmapStream);
BitmapStream.Position:=0;
EncodeStream(BitmapStream,strStream);
Result:=strStream.DataString;
BitmapStream.Free;
strStream.Free;
end;
function StringToBitmap(str:String):TBitmap;
var
BitmapStream:TMemoryStream;
strStream:TStringStream;
begin
strStream:=TStringStream.Create(str);
BitmapStream:=TMemoryStream.Create;
DecodeStream(strStream,BitmapStream);
BitmapStream.Position:=0;
result:=TBitmap.Create;
result.LoadFromStream(BitmapStream);
BitmapStream.Free;
strStream.Free;
end;
end.
Add comment May 4th, 2009
模拟器(emulator.exe)
你可以在 Android SDK 的安装目录下的 tools 文件夹找到运行文件(F:\GPhone\android-sdk-windows-1.0_r1\tools),双击运行模拟器。
安装 APK 包
adb install [-l] [-r] <file>
- push this package file to the device and install it
<’-l’ means forward-lock the app>
<’-r’ means reinstall the app, keeping its data>
例如:adb install F:\Gphone\MyCode\HelloAndroid\bin\HelloAndroid.apk
查看安装位置:
adb shell
#cd data
#cd app
#ls
显示已经安装的 APK 包
com.android.hello.apk
卸载 APK 包
adb shell
#cd data
#cd app
#ls
# rm com.android.hello.apk
Add comment April 17th, 2009
MessageBox.Show(Environment.GetEnvironmentVariable(”SystemRoot”).ToString());
MessageBox.Show(Environment.SystemDirectory.ToString());
Add comment April 16th, 2009
http://blog.csdn.net/ziren235/archive/2007/10/22/1837979.aspx
Add comment April 1st, 2009
“历史记录”按钮在哪呢?
在Chrome的界面上,Google将”历史记录”按钮与“后退”按钮综合在了一起。当你将鼠标指针移向后退箭头的时候,在按下鼠标左键的同时停顿几秒,会弹出一个菜单显示你最近访问的几个页面。你也可以通过这个菜单查看整个历史记录(支持搜索功能)。
“主页”选项按钮在哪?
初次安装之后的Chrome是没有“主页”按钮的。你可以通过以下操作来激活它:打开“选项”对话框(点击浏览器右上方那个扳手图标,然后选择“选项”),然后选择“基本信息”标鉴页面,选中“在工具栏上显示主页按钮”复选框后确定即可。
“收藏夹”工具栏使用?
通过组合键“Ctrl+B”可以实现隐藏和显示“收藏夹”工具栏;收藏网址请单击地址栏右边的“五角星”图标
Add comment March 3rd, 2009
You will get the error: A generic error occurred in GDI+. This problem occurs because until the bitmap object is disposed, it creates a lock on the underlying image file. So you can save the newly generated file with different name but not overwrite the file because of lock. Now suppose you want to overwrite the file then create another bitmap from old bitmap. process new bitmap object and save the new bitmap object with original file name.
Bitmap newB = new Bitmap(this.BackgroundBitmap.Width,this.BackgroundBitmap.Height);
Graphics newG = Graphics.FromImage(newB);
newG.DrawImage(this.BackgroundBitmap,new Rectangle(0,0,this.BackgroundBitmap.Width,this.BackgroundBitmap.Height),
new Rectangle(0,0,newB.Width,newB.Height),GraphicsUnit.Pixel);
newB.Save(mem,ImageFormat.Bmp);
//this.BackgroundBitmap.Save(mem,ImageFormat.Bmp);
newG.Dispose();
newB.Dispose();
Add comment December 17th, 2008
1. JDK 下载、安装、配置
下载最新的 JDK,我下载的是 Java SE Development Kit (JDK) 6 Update 10
双击直接运行,默认安装位置 C:\Program Files\Java
右键单击 “我的电脑” / “属性” / “高级” / “环境变量”
a. 新建一个系统变量 JAVA_HOME / C:\Program Files\Java\jdk1.6.0_10
b. 在 Path 变量里加入 ;%JAVA_HOME%\bin
2. Android SDK 下载、安装、配置
直接解压到目标目录即可
右键单击 “我的电脑” / “属性” / “高级” / “环境变量”
a. 在 Path 变量里加入 ;F:\GPhone\android-sdk-windows-1.0_r1\tools
3. Eclipse 下载、安装、配置
下载 Eclipse,我下载的是 Eclipse Classic 3.4.1
直接解压到目标目录即可
JDK 配置
a. “Window” / “Preferences” / “Java” / “Installed JREs”
ADT 安装
a. “Help” / “Software Updates…” / “Add Site…”
b. 输入 “https://dl-ssl.google.com/android/eclipse/”
c. 选中安装的插件 “Android Developer Tools” / “Android Editors”,单击 “Install…”
d. 安装完成后重启 Eclipse
问题:No repository found at https://dl-ssl.google.com/android/eclipse/
把 https://dl-ssl.google.com/android/eclipse/ 更改为 http://dl-ssl.google.com/android/eclipse/ 即可
Add comment December 1st, 2008
电影一般,插曲不错。
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Add comment November 19th, 2008
在 Delphi 开发中,打印画布上填充方式为非 bsSolid 的图形时,打印出来后会变成黑色的背景,显然这不是我们要的效果。
为什么会出现左图这种不正常的情况呢?
打印非 bssolid 笔刷填充方式的主要问题是 GDI 采用单色小 8* 8 位图来实现这些填充效果,在计算机屏幕排列可以得到你想要的效果,但是在高分辨率的打印机上, 由于模式的排列太靠近,以至于看起来合并到一块了,从而会产生这样的打印问题。
解决的办法是使用 SetBkColor API 函数,下面是示例:
Add comment November 19th, 2008