Petr, I found another bug. When the user Saves a picture as the same name of an existing picture, first it asks if you want to overwrite it, which is good, but then when it saves it, it saves with a second extension to it. For example, if you save over another one called picture.jpg, it will save the file as picture.jpg.jpg
So, I found a way around this in my own Paint Pixels 7 program by calculating the number of characters of nm$ with LEN and then reducing the characters from nm$ with RIGHT$. Below is what I made. Also, just so you know, your OPEN and SAVE dialogue has the exact same OFN commands which shouldn't be done. Because when you open a file, it has nothing to do with overwrite. So, I put in the same OFN commands as I did yesterday and it works fine. If you need help with my code, please ask. But THANK YOU for fixing the other Save problem I had, at least I don't need to add the .jpg anymore. I also used your idea and letting the user to my program save as JPG, PNG, or BMP. :))))
If you need help with my code below, please ask. Oh also, there's a very slight minor bug as well, which I have no idea if it can be fixed, but when the user switches directories to open a picture file and looks on the JPG, PNG, BMP list for some reason it's adding a part of the _TITLE text after that on that same list. LOL
'Saving Section
saving:
nm$
= GetSaveFileName
("Save Image", ".\", "JPG Image (.jpg)|*.jpg|PNG Image (.png)|*.png|BMP Image (.bmp)|*.bmp", 1, OFN_OVERWRITEPROMPT
+ OFN_NOCHANGEDIR
, _WINDOWHANDLE) nm$
= LEFT$(nm$
, letters
- 4)Result
= SaveImage
(nm$
, 0, 0, 0, _WIDTH(img
), _HEIGHT(img
)) 'first zero is your screen, second zero is X start, 3th zero is y startnm$ = ""
skipsave:
dMode = 1
m = 1
'Loading Section
loading:
nm$
= GetOpenFileName$
("Open Image", ".\", "JPG Image (.jpg)|*.jpg|PNG Image (.png)|*.png|BMP Image (.bmp)|*.bmp", 1, OFN_FILEMUSTEXIST
+ OFN_NOCHANGEDIR
+ OFN_READONLY
, _WINDOWHANDLE)l = 0
s& = i&
i& = 0
skipopen:
dMode = 1
m = 1