Do Not Work function ImageFromImage(sourceImg: image; x: integer; y: integer; width: integer; height: integer ): image;
I've tested the following code in MP 3.3 ALPHA and it works fine:
program testII; begin drawImage(ImageFromImage(loadImage('/icon.png'), 0, 0, 8, 8), 0, 0); repaint; delay(1000); end.
Do you have a piece of code in which it does not works? Please post it here and I'll check it out.
Thanks.
Used Kemulator. In version 2.2 everything works, but in 3.3 there is no.
program PRO; var ABC: Image; procedure DRAWtex(T:String); var SummT,IndT,tX,tY:Integer; Ch:Char; begin SummT:=Length(T); IndT:=0; tX:=5; tY:=5; repeat Ch:=GetChar(T,IndT); if Ch='а' then DrawImage(ImageFromImage(ABC,0,0,18,24), tX, tY); if Ch='б' then DrawImage(ImageFromImage(ABC,18,0,18,24), tX, tY); if Ch='в' then DrawImage(ImageFromImage(ABC,36,0,18,24), tX, tY); if Ch='г' then DrawImage(ImageFromImage(ABC,54,0,18,24), tX, tY); if Ch='д' then DrawImage(ImageFromImage(ABC,72,0,18,24), tX, tY); if Ch='е' then DrawImage(ImageFromImage(ABC,90,0,18,24), tX, tY); if Ch='ё' then DrawImage(ImageFromImage(ABC,108,0,18,24), tX, tY); if Ch='ж' then DrawImage(ImageFromImage(ABC,126,0,18,24), tX, tY); if Ch='з' then DrawImage(ImageFromImage(ABC,144,0,18,24), tX, tY); if Ch='и' then DrawImage(ImageFromImage(ABC,162,0,18,24), tX, tY); if Ch='й' then DrawImage(ImageFromImage(ABC,180,0,18,24), tX, tY); if Ch='к' then DrawImage(ImageFromImage(ABC,198,0,18,24), tX, tY); if Ch='л' then DrawImage(ImageFromImage(ABC,216,0,18,24), tX, tY); if Ch='м' then DrawImage(ImageFromImage(ABC,234,0,18,24), tX, tY); if Ch='н' then DrawImage(ImageFromImage(ABC,252,0,18,24), tX, tY); if Ch='о' then DrawImage(ImageFromImage(ABC,270,0,18,24), tX, tY); if Ch='п' then DrawImage(ImageFromImage(ABC,288,0,18,24), tX, tY); if Ch='р' then DrawImage(ImageFromImage(ABC,0,24,18,24), tX, tY); if Ch='с' then DrawImage(ImageFromImage(ABC,18,24,18,24), tX, tY); if Ch='т' then DrawImage(ImageFromImage(ABC,36,24,18,24), tX, tY); if Ch='у' then DrawImage(ImageFromImage(ABC,54,24,18,24), tX, tY); if Ch='ф' then DrawImage(ImageFromImage(ABC,72,24,18,24), tX, tY); if Ch='х' then DrawImage(ImageFromImage(ABC,90,24,18,24), tX, tY); if Ch='ц' then DrawImage(ImageFromImage(ABC,108,24,18,24), tX, tY); if Ch='ч' then DrawImage(ImageFromImage(ABC,126,24,18,24), tX, tY); if Ch='ш' then DrawImage(ImageFromImage(ABC,144,24,18,24), tX, tY); if Ch='щ' then DrawImage(ImageFromImage(ABC,162,24,18,24), tX, tY); if Ch='ь' then DrawImage(ImageFromImage(ABC,180,24,18,24), tX, tY); if Ch='ы' then DrawImage(ImageFromImage(ABC,198,24,18,24), tX, tY); if Ch='ъ' then DrawImage(ImageFromImage(ABC,216,24,18,24), tX, tY); if Ch='э' then DrawImage(ImageFromImage(ABC,234,24,18,24), tX, tY); if Ch='ю' then DrawImage(ImageFromImage(ABC,252,24,18,24), tX, tY); if Ch='я' then DrawImage(ImageFromImage(ABC,270,24,18,24), tX, tY); if Ch=',' then DrawImage(ImageFromImage(ABC,288,24,18,24), tX, tY); if (tX+18+18)<GetWidth then tX:=tX+18; else begin tX:=5; tY:=tY+24; end; IndT:=IndT+1; until (IndT+1)>SummT; end; begin ABC:=LoadImage('/ABC.png'); SetColor(0, 140, 200); FillRect(0, 0, GetWidth, GetHeight); DRAWtex('здравствуй мир'); repaint; delay(20000); end.
So working in 2.2 and 3.3:
program PRO; var ABC: Image; procedure DRAWtex(T:String); var SummT,IndT,tX,tY:Integer; Ch:Char; begin SummT:=Length(T); IndT:=0; tX:=5; tY:=5; repeat Ch:=[b]GetChar(T,IndT)[/b]; if [b]Ch='a'[/b] then DrawImage(ImageFromImage(ABC,0,0,18,24), tX, tY); if Ch='b' then DrawImage(ImageFromImage(ABC,18,0,18,24), tX, tY); if Ch='c' then DrawImage(ImageFromImage(ABC,36,0,18,24), tX, tY); if Ch='d' then DrawImage(ImageFromImage(ABC,54,0,18,24), tX, tY); if Ch='e' then DrawImage(ImageFromImage(ABC,72,0,18,24), tX, tY); if Ch='f' then DrawImage(ImageFromImage(ABC,90,0,18,24), tX, tY); if Ch='g' then DrawImage(ImageFromImage(ABC,108,0,18,24), tX, tY); /// ….. /// if (tX+18+18)<GetWidth then tX:=tX+18; else begin tX:=5; tY:=tY+24; end; IndT:=IndT+1; until (IndT+1)>SummT; end; begin ABC:=LoadImage('/ABC.png'); SetColor(0, 140, 200); FillRect(0, 0, GetWidth, GetHeight); DRAWtex('abcdefg'); repaint; delay(20000); end.
Hence the problem of Russian letters.
I see. Check my last reply in the following topic:
http://sourceforge.net/projects/midletpascal/forums/forum/1013750/topic/3762044
Thanks for your report anyway.
Log in to post a comment.
Do Not Work function ImageFromImage(sourceImg: image; x: integer; y: integer; width: integer; height: integer ): image;
I've tested the following code in MP 3.3 ALPHA and it works fine:
Do you have a piece of code in which it does not works? Please post it here and I'll check it out.
Thanks.
Used Kemulator. In version 2.2 everything works, but in 3.3 there is no.
So working in 2.2 and 3.3:
Hence the problem of Russian letters.
I see. Check my last reply in the following topic:
http://sourceforge.net/projects/midletpascal/forums/forum/1013750/topic/3762044
Thanks for your report anyway.