English
Source / code snippets

Image Hpic2txt Pixel Text Txt2hpic

 

CompileMarkSeparation
cls
var hPic&=create("hPic",-1,"elk.png")
var text$=hpic2txt(hPic&,%bmpx,%bmpy)
deleteobject hPic&
assign #1,"bild.txt"
rewrite #1
print #1,text$
close #1
//
hPic&=txt2hpic(text$,%bmpx,%bmpy)
drawPic hPic&,0,0;0
deleteobject hPic&
waitinput
end

proc txt2hpic

    parameters s$,_width&,_height&
    s$=decode64(s$)
    var hPic&=create("hNewPic",_width&,_height&,0)
    var sz&=((_width&*328-1) | 3+1)*abs(_height&)
    declare mem#
    dim mem#,40
    long mem#,0=40,_width&,_height&,0,0,sz&
    byte mem#,12=1
    byte mem#,14=32
    external("gdi32.dll","SetDIBits",%hDC,hPic&,0,_height&,addr(s$),mem#,0)
    dispose mem#
    return hPic&

endproc

proc hpic2txt

    parameters h&,_width&,_height&
    var sz&=((_width&*328-1) | 3+1)*abs(_height&)
    declare mem#
    dim mem#,40
    long mem#,0=40,_width&,_height&,0,0,sz&
    byte mem#,12=1
    byte mem#,14=32
    declare pixels#
    dim pixels#,sz&

    ifnot external("gdi32.dll","GetDIBits",%hDC,h&,0,_height&,pixels#,mem#,0)

        dispose pixels#,mem#
        return 0

    endif

    var txt$=encode64(char$(pixels#,0,_width&*_height&*4-4))
    dispose pixels#,mem#
    return txt$

endproc

 
11/28/09  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.878 Views

Untitledvor 0 min.
Michael Hettner05/06/22
H.Brill02/10/22
AndreasS01/10/19
funkheld01/12/14
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie