Add(InlineCode,14557124,378,480) { @Hint=#7:Palette| WorkPoints=#12:doMonochrome|10:do16Colors|11:do256Colors|13:do65536Colors|12:doTrueColors|17:doAlphaTrueColors| EventPoints=#8:onResult| DataPoints=#6:Bitmap| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|30: onResult,Bitmap: THI_Event;|22: onCount: THI_Event;|55: procedure doMonochrome(var _Data:TData; Index:word);|53: procedure do16Colors(var _Data:TData; Index:word);|54: procedure do256Colors(var _Data:TData; Index:word);|56: procedure do65536Colors(var _Data:TData; Index:word);|55: procedure doTrueColors(var _Data:TData; Index:word);|60: procedure doAlphaTrueColors(var _Data:TData; Index:word);|7: end;|3: |14:implementation|0:|35:procedure THiAsmClass.doMonochrome;|3:var|19: bmp,src: PBitmap;|5:begin|38: bmp := ReadBitmap(_Data,Bitmap,nil);|24: src := NewBitmap(0,0);|26: if bmp <> nil then begin|21: src.Assign(bmp);|31: src.PixelFormat := pf1bit;|8: end; |28: _hi_OnEvent(onResult,src);|11: src.free;|4:end;|0:|33:procedure THiAsmClass.do16Colors;|3:var|19: bmp,src: PBitmap;|5:begin|38: bmp := ReadBitmap(_Data,Bitmap,nil);|24: src := NewBitmap(0,0);|26: if bmp <> nil then begin|21: src.Assign(bmp);|31: src.PixelFormat := pf4bit;|8: end; |28: _hi_OnEvent(onResult,src);|11: src.free;|4:end;|0:|34:procedure THiAsmClass.do256Colors;|3:var|19: bmp,src: PBitmap;|5:begin|38: bmp := ReadBitmap(_Data,Bitmap,nil);|24: src := NewBitmap(0,0);|26: if bmp <> nil then begin|21: src.Assign(bmp);|31: src.PixelFormat := pf8bit;|8: end; |28: _hi_OnEvent(onResult,src);|11: src.free;|4:end;|0:|36:procedure THiAsmClass.do65536Colors;|3:var|19: bmp,src: PBitmap;|5:begin|38: bmp := ReadBitmap(_Data,Bitmap,nil);|24: src := NewBitmap(0,0);|26: if bmp <> nil then begin|21: src.Assign(bmp);|32: src.PixelFormat := pf16bit;|8: end; |28: _hi_OnEvent(onResult,src);|11: src.free;|4:end;|0:|35:procedure THiAsmClass.doTrueColors;|3:var|19: bmp,src: PBitmap;|5:begin|38: bmp := ReadBitmap(_Data,Bitmap,nil);|24: src := NewBitmap(0,0);|26: if bmp <> nil then begin|21: src.Assign(bmp);|32: src.PixelFormat := pf24bit;|8: end; |28: _hi_OnEvent(onResult,src);|11: src.free;|4:end;|0:|40:procedure THiAsmClass.doAlphaTrueColors;|3:var|19: bmp,src: PBitmap;|5:begin|38: bmp := ReadBitmap(_Data,Bitmap,nil);|24: src := NewBitmap(0,0);|26: if bmp <> nil then begin|21: src.Assign(bmp);|32: src.PixelFormat := pf32bit;|8: end; |28: _hi_OnEvent(onResult,src);|11: src.free;|4:end;|0:|4:end.| }