create program to create bitmap

Game development specific discussions.
dodicat
Posts: 5814
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: create program to create bitmap

Postby dodicat » Jun 20, 2017 23:22

Here is a clipboard option to retrieve a forum text file.
(Windows)

Code: Select all

#include "windows.bi"
#include "win\Commdlg.bi"
#Include once "/win/commctrl.bi"
#Include "win/shellapi.bi"
freeconsole
Dim As hwnd Main=CreateWindowEx(0,"#32770","Picture finder",WS_OVERLAPPEDWINDOW Or WS_VISIBLE,0,0,800,300,0,0,0,0)
Dim As Any Ptr btn=CreateWindowEx( 0,"BUTTON","Open", ws_border Or WS_VISIBLE Or WS_CHILD ,150,50,100,30,Main,0,0,0)
Dim As Any Ptr fname  =createwindowex(0,"Static",""  , WS_VISIBLE Or WS_CHILD,0,150,800,30,Main,0,0,0)
Dim As Any Ptr btn2  =createwindowex(0,"BUTTON","Open Clipboard"  ,ws_border Or WS_VISIBLE Or WS_CHILD,280,50,120,30,Main,0,0,0)
Dim As hwnd tip 'tooltip
Declare Sub getfiles(As OpenFileName)
Declare Function CreateToolTip(As hwnd,As String="") As hwnd
Declare Function loadfile(file As String) As String
Declare Sub savefile(filename As String,p As String)
Declare Function compress(Byval num As String) As String
Declare Function uncompress(Byval num As String) As String
declare Function get_clipboard() As String

Dim BMPfile As OpenFileName
Dim As msg msg1

tip=CreateToolTip(btn,"Search for zipped pictures or imagefile.txt")
tip=CreateToolTip(btn2,"Get a text file from the clipboard")

freeconsole

setWindowText(fname,".zip or imagefile.txt")

While GetMessage(@msg1,0,0,0)
    TranslateMessage(@msg1)
    DispatchMessage(@msg1)
    Select Case msg1.hwnd
    Case Main
        Select Case msg1.message
        Case 273  'close by clicking X
            End
        Case WM_RBUTTONDOWN
            Screen 0
        End Select
        '-----------------------------
    case btn2 'clipboard option
      Select Case msg1.message 
      Case WM_LBUTTONDOWN
          var f=get_clipboard
          Screen 19
            Color 0,9
            Cls
            print
            print "Length of clipboard file ";len(f)
            print
            print "Directory in use "; curdir
            if len(f)>1000 then
            savefile("imagefile.txt",f)
            print "Clipboard saved as imagefile.txt"
            print
            print "You can use the open button to navigate to this file."
        else
            print "File seems too small for an image, so it has not been processed."
            end if
          end select
    Case btn
        Select Case msg1.message 
        Case WM_LBUTTONDOWN
           
            getfiles(BMPfile)
            Dim As String s=*BMPfile.lpstrFile
       
            Screen 19
            Color 0,7
            Cls
            Screencontrol 100,50,300
            Print
            If Right(s,3)<>"txt" Then
            Print "please wait"
            Print "File to modify ---> ";s
            Var s1 =loadfile(s)
            If Len(s1)=0 Then Print "no file chosen":Exit select
            Print "Length of Original file "; Len(s1)
           ' If Len(s1)>35000 Then Print "File too large at ";Len(s1);" characters, press a key and choose another ":Sleep:Cls::Exit Select
            Print "Building ..."
            Print "Compressing ..."
            Var c=compress(s1)
            savefile("imagefile.txt",c)
           
           
            Print "Length of compressed file"; Len(c);" <----- FORUM READABLE------>  (Imagefile.txt)"
            Print
            Print "Press a key to see the text file"
            Sleep
            Var cc=Curdir
           
            Print "Text file path is " + cc+"\image.txt"
            ShellExecute (0,"","notepad.exe ",cc+"\imagefile.txt","",SW_SHOWNORMAL)
            End If
            'if a text file is chosen
            If  Right(s,3)="txt" Then
            Print "please wait ... (a text file has been chosen)"
            Var s1 =loadfile(s)
              Print "File to modify ---> ";s
            If Len(s1)=0 Then Print "no file chosen":Exit select
            Print "Length of text file "; Len(s1)   
            Var uc=uncompress(s1)
             Print "Length of image file "; Len(uc)
             savefile("imagefile"+".zip",uc)
             Print
             Print "imagefile"+".zip has been saved in the same folder"
             Print
             Print "You can close the program and unzip this file"
            End If
           
        End Select
        '------------------------------
    End Select
   
Wend

Sub getfiles(Byref BMPfile As OpenFileName)
    Dim As zstring * 2048 SELFILE
    Dim As String MYFILTER
    MYFILTER = "image Files"+Chr(0)+"*.zip;imagefile.txt"+Chr(0)
    With BMPfile
        .lStructSize = Sizeof(OpenFileName)
        .hInstance = null
        .lpstrFilter = Strptr(MYFILTER)
        .lpstrFile = @SELFILE
        .nMaxFile = 2048
        .nMaxFileTitle = 0
        .lpstrTitle =@"Open"
    End With
    GetOpenFileName(@BMPfile)
End Sub

Function CreateToolTip(X As hwnd,msg As String="") As hwnd
    Dim As hwnd  TT= CreateWindowEx(0,"ToolTips_Class32","",64,0,0,0,0,X,0,GetModuleHandle(0),0)
                                                          '64=bubble,0 = rectangle
    SendMessage(TT, TTM_SETMAXTIPWIDTH, 0 , 180)
    SendMessage(TT, TTM_SETDELAYTIME, TTDT_INITIAL ,40)
    SendMessage(TT, TTM_SETDELAYTIME, TTDT_RESHOW  ,60)
    Dim bubble As TOOLINFO
    bubble.cbSize = Len(TOOLINFO)
    bubble.uFlags = TTF_IDISHWND Or TTF_SUBCLASS
    bubble.uId = Cast(Uinteger,X)
    bubble.lpszText = Strptr(msg)
    SendMessage(TT, TTM_ADDTOOL, 0,Cast(LPARAM,@bubble))
    Return TT
End Function

Function get_clipboard() As String
        If IsClipboardFormatAvailable(CF_TEXT) = 0 Then Return "Error"
        If OpenClipboard(0) = 0 Then Return "Error"
        Function = *Cast(zstring Ptr,GetClipboardData(CF_TEXT))
        CloseClipboard()
End Function

Function build(ByVal s As String) As String
    Dim As String acc
    For n As Long=0 To Len(s)-1
       acc+=Right("000" + Str(s[n]),3)
    Next
    Return acc
End Function

Function rebuild(ByVal s As String) As String
    Dim As String acc
    For n As Long=1 To Len(s) Step 3
        acc+=Chr(ValLng(Mid(s,n,3)))
    Next
    Return acc
End Function

Function loadfile(file As String) As String
    Var  f=Freefile
    Open file For Binary Access Read As #f
    Dim As String text
    If Lof(1) > 0 Then
        text = String(Lof(f), 0)
        Get #f, , text
    End If
    Close #f
    Return text
End Function

Sub savefile(filename As String,p As String)
    Dim As Integer n
    n=Freefile
    If Open (filename For Binary Access Write As #n)=0 Then
        Put #n,,p
        Close
    Else
        Print "Unable to load " + filename
    End If
End Sub

Function to128(ByVal i As ULong) As String
   Dim As String g
   Dim As ULong d,m,begin=32
   Do
    d=i\128
    m=i And 127
    g=chr((m)+begin)+g
    i=d
   loop until i=0 
   Return g
End Function

Function To10(ByVal Number As String) As ULong
            Dim As ULong sum,begin=32
            sum=(Asc(Left(Number,1))-begin)
            For n As Integer=2 To Len(Number)
                      Var z=(Number[n-1])
                       sum=(sum Shl 7)+ z-begin
            Next n
            Return sum
 End Function

Function compress(ByVal b256 As String) As String
   Var b=build(b256),d=String(4,Chr(32))
   Dim As String acc
   For n As Long=1 To Len(b) Step 9
      Var tmp=(Mid(b,n,9))
   acc+=   Right(d+ Str(to128(ValuLng(tmp))),4)
   Next
   Return acc
End Function

Function uncompress(ByVal b128 As String) As String
   Var d=String(9,"0")
   Dim As String acc
   For n As Long=1 To Len(b128) Step 4
      Var tmp=(Mid(b128,n,4))
   acc+=   (Right(d+ Str(to10(tmp)),9))
   Next
   Return rebuild(acc)
End Function

 
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: create program to create bitmap

Postby Cherry » Jun 30, 2017 11:31

Excuse my ignorance, but what is the benefit of using such a complicated method compared to simply uploading an image file (preferrably PNG - lossless compression) somewhere and posting it, or in case it's about the understandable fear of hosters going down and links becoming dead, posting a base64 representation of the PNG, maybe even as data URL so all one has to do is copying it into the address bar in order to get a viewable and saveable image?

I see this thread having 20 pages and I read through half of them but I didn't understand why all these tricks are even needed in the first place in order to share images in the forum...
MrSwiss
Posts: 3125
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: create program to create bitmap

Postby MrSwiss » Jun 30, 2017 12:12

A short explanation to your questions, can be found, here ...
As well as a continued discussion of various technicalities ...
And, the most current Utility: ver. 0.51.
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: create program to create bitmap

Postby leopardpm » Jun 30, 2017 15:48

Cherry wrote:or in case it's about the understandable fear of hosters going down and links becoming dead, posting a base64 representation of the PNG, maybe even as data URL so all one has to do is copying it into the address bar in order to get a viewable and saveable image?

what is a 'data url'?
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: create program to create bitmap

Postby Cherry » Jun 30, 2017 15:58

https://en.wikipedia.org/wiki/Data_URI_scheme

Code: Select all

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAEAAQADASIAAhEBAxEB/8QAHAAAAgMBAQEBAAAAAAAAAAAAAwQCBQYHAQAI/8QAShAAAQIEAwQFCAgEBQMDBQAAAgEDAAQREgUhIgYTMTJBQlFSYhRhcXKBgpLwByORoaKywuIVscHSFjND0fIkU/ElY+E0RFSDk//EABkBAAIDAQAAAAAAAAAAAAAAAAIDAAEEBf/EACgRAAICAQMEAQQDAQAAAAAAAAABAhEDEiExBBNBUSIUMkJhBSNxgf/aAAwDAQACEQMRAD8A4zPrFEJf9TF1PFzRSJ/9SPpjDjOrm5NFKF9VBoBK/wCTBuEU+RkeBmW/pDowjLLDwqkbum4OH/Jfcj4+UorTeVl0sotLawlNSyKkaZqzn456GKTk0jqD3oppzUJQ08NpcYTehXBqi9Tsz00lHIEHGGp4bSKFm+aANC4Gw5I9Zc3ZREeSBlFAou5aaSgw4EyHbGWF0h5ViXlZJC3A0LL7NWMynmj3eosZcJw4cafIorthd1F3vEjwnEpFS48Qp0wmc6daZxWhlrKi5cdSEXHoVaeJ3oWCOMnbWkEoMB5USF3vQTygUGK4hdrwj3cvL0RKIpjT05VIrHnFKDHLO+eAGCiOpIuJTdgS4xYYdqKK8uMWuFDUomTgmPkfcbqMJuNIsWTw6YUPOM0JjpIq3m6QsSRaPtwk435o0RmKaNnOjzRRXf8AUxez/LFGI1mIyYzoZi+lC+rGCEsBlktEYYtiPkZHgLLKt0WALCLNIbBY3dOcX+S5QcViD/CJtao8meRfRGuRyo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3RKIRdJIARZx65WAGixcUQJvEpEScugJViFYKiH//Z


Paste this into your browser's address bar to see what I mean! It's an URL which actually contains the image instead of linking to it.
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: create program to create bitmap

Postby leopardpm » Jun 30, 2017 16:11

what the...?! That is amazing!

So... how is the data created? I am not understanding the 'creation' process for the data url

also, what is the # of characters limit of the data URL?
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: create program to create bitmap

Postby Cherry » Jun 30, 2017 16:15

Actually, if the board's filter would allow things starting with "data:" to be treated as link or image source, it would be even nicer.

Using base64, it is "data:" + mimetype + ";base64," + base64-encoded contents of the file. (There is also a "raw" way.)

There are tons of generators online, e.g. https://dopiaza.org/tools/datauri/index.php

There is no character limit in theory, but the forum has a limit of 60000 characters per post as far as I know.

EDIT: I think a compromise could even be creating a small external service which takes a data URL (maybe without the "data:" part to prevent confusing the forum software) as part of its path and returns its contents as body or even just does a 302 redirect to the given data URL, for example "http://something.com/image/jpeg;base64,asdcuas......". Then, such a URL can be used to provide links to download, show the images inline in the forum, etc., but the data is still here, and if one day this service would no longer exist, it is still possible to get the data by just right-clicking the link/image, copying the URL, replacing "http://something.com" with "data:" and using the manual method of copying and pasting instead again...

EDIT2: However, the data is of course not as compressed this way as with the ForumBlobPost tool which MrSwiss mentioned above. But it would be relevant only for files larger than around 40KB.
Last edited by Cherry on Jun 30, 2017 16:27, edited 1 time in total.
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: create program to create bitmap

Postby leopardpm » Jun 30, 2017 16:26

very nifty! Thank you... I think this is a great option... it would be good if Mr. Swiss's utility could also decrypt the url with the added header info, just to make it easy if someone like using his utility instead.

I really like being able to view the image without downloading it, and while viewing it one can right-click and save the actual image file instead of using the decoder or a text file (or any of the other conniptions we have tried...)
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: create program to create bitmap

Postby Cherry » Jun 30, 2017 17:07

An example of what I imagined:

Link:
Click me

Inline image:
Image

To use it as data URL (in case the service is down for example), you would just need to remove the "http://dataurl.app.dotlabs.co/" in front of the URL.

(This whole trick is only necessary because the forum thinks that something starting with "data:" can't be an URL and refuses to show it as image for example, even though your browser would be fine with that.)

Note that I made this service as a quick proof of concept, it is NOT meant to be used in production and I may close it again any time! (But it wouldn't be a lot of effort to make it a long-term service.)
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: create program to create bitmap

Postby leopardpm » Jun 30, 2017 17:22

Cherry wrote:
Cherry wrote:An example of what I imagined.....

Note that I made this service as a quick proof of concept, it is NOT meant to be used in production and I may close it again any time! (But it wouldn't be a lot of effort to make it a long-term service.)
so, you are 'hosting' this image/data?

"http://dataurl.app.dotlabs.co/"
MrSwiss
Posts: 3125
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: create program to create bitmap

Postby MrSwiss » Jun 30, 2017 17:43

@leopardpm,
leopardpm wrote:very nifty! Thank you... I think this is a great option... it would be good if Mr. Swiss's utility could also decrypt the url with the added header info, just to make it easy if someone like using his utility instead.
Before going all "over board", have you read the last paragraph on Wikipedia, about security?

Secondly:
it would require, to use the "Standard compliant" Alphabet (less speed, less security).
It is only an added layer of security, by NOT using the Standard, which is common
knowledge to all, by now (even and/or especially, the "badies" know it!).

Thirdly:
no more .zip file support ... (images only)
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: create program to create bitmap

Postby Cherry » Jun 30, 2017 18:27

@leopardpm: No I'm not hosting it, the forum is hosting it. It is just sent to this service and returned as regular HTTP response body in order to work around the forum issue I mentioned, whenever the browser displays it.

(It is true that I or whoever runs such a service could therefore know everything which is encoded that way, that's the downside, but for a public forum with no existing private messaging system it wouldn't matter.)

@MrSwiss:

Just to make that clear: I'm not against your software and I don't want to force my ideas on anybody. I'm just pointing out solutions which I felt that nobody had considered in this thread before and their plus and minus. I have no interest in what you actually use at the end of the day. But:

1) Wikipedia security: Of course it can be used for bad purposes too, like every technology. Did you know most of the bad things on the internet are transfered via HTTP? But we shouldn't stop using HTTP because of that, should we? ;)

2) Wait a second, first of all I though the point was to allow sharing small files on the forum without externally hosting them, and it would even be a benefit to see images without pasting them into another tool...? If we were talking about some kind of "encryption", then something is wrong here anyway because your statement sounds like security through obscurity which is no security at all. If you want to hide the data, encrypt (not encode!) it, but then there is no use in putting it on a forum anyway. (I don't know what "badies" you are refering to in this context.) It's of course true that the standard alphabet has less storage density, but I mentioned that before, and for <40KB files it is still fine. (And, seriously, you are talking about speed for files which have to fit into a 60k characters limit, in 2017? The fact that you can use the browser instead of an external tool should make that argument baseless anyway because this will always be faster than using some external application to save a file...)

3) Why do you think ZIP or other files wouldn't work? Here, try this one:

Code: Select all

data:application/x-zip-compressed;base64,UEsDBAoAAAAAAEij3kqe2EKwBwAAAAcAAAAJAAAAaGVsbG8udHh0SGVsbG8hClBLAQI/AAoAAAAAAEij3kqe2EKwBwAAAAcAAAAJACQAAAAAAAAAIAAAAAAAAABoZWxsby50eHQKACAAAAAAAAEAGAC+qAhbzvHSAZ29B1vO8dIBnb0HW87x0gFQSwUGAAAAAAEAAQBbAAAALgAAAAAA


I think leopardpm's idea of an interoperability between these different ways would be cool, though.
MrSwiss
Posts: 3125
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: create program to create bitmap

Postby MrSwiss » Jun 30, 2017 18:44

@Cherry,
Cherry wrote:allow sharing small files on the forum without externally hosting them, and for <40KB files

slight error there, the idea initially was: to make the most/best, possible use of the 60'000 allowed
char's the forum provides ... (aka: largest possible file size).

A bit of obscurity, doesn't do any harm ... (it comes at a price of: 0.00)
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: create program to create bitmap

Postby leopardpm » Jun 30, 2017 18:48

Cherry wrote:3) Why do you think ZIP or other files wouldn't work? Here, try this one:

Code: Select all

data:application/x-zip-compressed;base64,UEsDBAoAAAAAAEij3kqe2EKwBwAAAAcAAAAJAAAAaGVsbG8udHh0SGVsbG8hClBLAQI/AAoAAAAAAEij3kqe2EKwBwAAAAcAAAAJACQAAAAAAAAAIAAAAAAAAABoZWxsby50eHQKACAAAAAAAAEAGAC+qAhbzvHSAZ29B1vO8dIBnb0HW87x0gFQSwUGAAAAAAEAAQBbAAAALgAAAAAA


VERY COOL!


I think leopardpm's idea of an interoperability between these different ways would be cool, though.
yes... though it seems your way is MUCH easier all the way around...

I don't understand the issue you are having with 'security', Mr. Swiss - this is a public forum... what exactly will we be transferring that needs some sort of secure encryption? I imagine we could actually transfer encrypted files by encrypting them then ZIPping them and doing it his way.... but its useless because we are making public the entire method anyways..

Mr. Swiss wrote:slight error there, the idea initially was: to make the most/best, possible use of the 60'000 allowed
char's the forum provides ... (aka: largest possible file size).
yes, and his method is just as effective as ours, right?
Cherry
Posts: 351
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Re: create program to create bitmap

Postby Cherry » Jun 30, 2017 18:58

@leopardpm: No, it's true that base64 by definition reduces the efficency because it requires more storage than unencoded data by a factor of 133%, i.e. a 3000 bytes file would need 4000 characters to encode (plus a few "header" bytes).

@MrSwiss:

If I read how this thread started, I believe it was about sharing images. I understood by now that it's an important point to do so without an external file upload service and I see the benefits of that.

For using every last bit of a post: If this becomes necessary for something (e.g. text plus image(s) are too large), more complicated alternatives can be worth the effort (and the convenience cost), yes, but I assume that this will be the exception to the rule in case of everyday posts where somebody just wants to add an image or two, or some other small file.

And I believe the obscurity does harm, because it causes extra effort for the viewers, and complexity to understand what is required to see the content, plus possible dependency on certain operating systems for which you provided binaries of your tool (otherwise the need to compile from source, only to view an image! or maybe there isn't even a way to compile it at all, e.g. on a laptop with Chromium OS), higher risk of corruption due to a bad forum update (I remember something like this happened to code tags before) exactly because of not just staying with a standard alphanumeric charset, etc. It also means I can't easily see an image on my phone, for example. In general it is yet another conflicting standard and I think we already have enough of these in IT industry. I don't understand what benefit you see in making it harder for people to see the things you wanted them to see (otherwise you wouldn't post them).

Return to “Game Dev”

Who is online

Users browsing this forum: No registered users and 2 guests