Author Topic: Paint Pixels 8 With Right-Click Menu  (Read 789 times)

Offline SierraKen

  • Forum Resident
  • Posts: 943
Re: Paint Pixels 8 With Right-Click Menu
« Reply #15 on: July 03, 2020, 02:07:08 PM »
I apologize, I just re-read what you said and I didn't open a file first, now I just did and see what you are talking about. On my computer it is making a bunch of squares or circles and one time. I will look into it. Thanks.
« Last Edit: July 03, 2020, 02:08:28 PM by SierraKen »

Offline SierraKen

  • Forum Resident
  • Posts: 943
Re: Paint Pixels 8 With Right-Click Menu
« Reply #16 on: July 03, 2020, 02:52:26 PM »
LOL I fixed it! After tinkering with it for about 30 minutes, it came to me instantly that I forgot to put a _PUTIMAGE command in the Loading section. I had a SCREEN command to show the loaded image, but I didn't put the brand new image in memory with _PUTIMAGE. That is why when you went directly to circles and boxes, it wouldn't know the last picture you loaded and it just threw circles on the screen without constantly putting the last image in it's place to make the animated resizing with the mouse. Whew! Thank you for pointing that out to me!

Here is the fixed version. Hopefully there's no more bugs. lol Please check though, I want to make sure before I post a final Version 8.

Update: Huge memory issue found, please delete this version if you have it. Zip file has been removed.
« Last Edit: July 04, 2020, 05:16:38 PM by SierraKen »

Offline Dav

  • Forum Regular
  • Posts: 237
Re: Paint Pixels 8 With Right-Click Menu
« Reply #17 on: July 03, 2020, 05:32:26 PM »
Cool - I'll give a good test tonight.

- Dav

Offline Dav

  • Forum Regular
  • Posts: 237
Re: Paint Pixels 8 With Right-Click Menu
« Reply #18 on: July 03, 2020, 07:27:08 PM »
Working great, @SierraKen!   I've made a few pics already and without any crashes.  I also tested it on my slower laptop, and it works smoothly on tha too.  Here's an image that used all the drawing tools and had no crashes.  The only thing I noticed is that after you save/load files more than once in the program there starts to appear gibberish on the bottom of the format selection line.  I'll post a small pic of that of what I mean.

Over all - good job!

- Dav

 


 



Online SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2584
    • Steve’s QB64 Archive Forum
Re: Paint Pixels 8 With Right-Click Menu
« Reply #19 on: July 03, 2020, 07:37:33 PM »
In response to Dav's last post:

Seems as if that's an image of a Windows Library call.  If so, the string sent with the variable types (JPG, PNG, gif, bmp...) probably needs to be null terminated.  (CHR$(0))
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SierraKen

  • Forum Resident
  • Posts: 943
Re: Paint Pixels 8 With Right-Click Menu
« Reply #20 on: July 03, 2020, 07:42:36 PM »
Thanks Dav!!! Yes, I've told other people about that gibberish problem a couple days ago and they pointed out it was because of my _TITLE command, which was a big reason I got rid of changing that command in the main loop. It copied text from it and put it there LOL. About the gibberish, I have no idea why it does that. It must be something in the OPENSAVE or the SaveImage libraries that is missing or something that cannot even be fixed, I have no idea, I didn't many any of the library files. If anyone out there knows of a way to fix it, I would be glad to change it. But it's a very very minor error and the funny thing is that I've seen this same problem before on older programs that weren't even from QB64.
I'll be working on adding windows text to the painted picture soon. I put up an example on a new thread you can check out if you want. Thanks again Dav for all your help.


Offline SierraKen

  • Forum Resident
  • Posts: 943
Re: Paint Pixels 8 With Right-Click Menu
« Reply #21 on: July 03, 2020, 07:45:46 PM »
Steve, would that be fixed in my program or would it be only in the libraries? Because I don't want to touch the libraries myself.

Online SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2584
    • Steve’s QB64 Archive Forum
Re: Paint Pixels 8 With Right-Click Menu
« Reply #22 on: July 03, 2020, 08:02:51 PM »
Steve, would that be fixed in my program or would it be only in the libraries? Because I don't want to touch the libraries myself.

It's probably on your side.  Look for the string where you set the acceptable file types, and add a + CHR$(0) to the end of it.  See if that doesn't correct the problem.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SierraKen

  • Forum Resident
  • Posts: 943
Re: Paint Pixels 8 With Right-Click Menu
« Reply #23 on: July 03, 2020, 08:15:33 PM »
Awesome, I think I got it! I tested it around 8 times or more and nothing gibberish or different comes up now. This is where I added that CHR$(0) at:

Code: QB64: [Select]
  1. saving:
  2. nm$ = GetSaveFileName("Save Image", ".\", "JPG Image (.jpg)|*.jpg|PNG Image (.png)|*.png|GIF Image (.gif)|*.gif|BMP Image (.bmp)|*.bmp" + CHR$(0), 1, OFN_OVERWRITEPROMPT + OFN_NOCHANGEDIR, _WINDOWHANDLE)
  3.  

and also here (because once I even found the gibberish on the tiny jpg, etc. list LOL):
Code: QB64: [Select]
  1. loading:
  2. nm$ = GetOpenFileName$("Open Image", ".\", "JPG Image (.jpg)|*.jpg|PNG Image (.png)|*.png|GIF Image (.gif)|*.gif|BMP Image (.bmp)|*.bmp" + CHR$(0), 1, OFN_FILEMUSTEXIST + OFN_NOCHANGEDIR + OFN_READONLY, _WINDOWHANDLE)
  3.  

Dav, is it fixed on your end?

« Last Edit: July 04, 2020, 05:17:20 PM by SierraKen »

Online SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2584
    • Steve’s QB64 Archive Forum
Re: Paint Pixels 8 With Right-Click Menu
« Reply #24 on: July 03, 2020, 08:32:37 PM »
That looks like the proper place to fix the issue to me.  👍
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SierraKen

  • Forum Resident
  • Posts: 943
Re: Paint Pixels 8 With Right-Click Menu
« Reply #25 on: July 03, 2020, 10:34:00 PM »
OK, I got the Text Mode all finished! Dav or someone else can try it out for me if you wish. I tested it many times myself. It requires Windows to use the Arial Font and lets you select the size from 12 to 72. After you choose Text on the menu, it asks you on the screen what text you want and after pressing Enter, it asks you what size (12-72). Then you left click anywhere on the screen to add it. You can only do one at a time but you just do it over again if you want another one, right click for the menu and choose Text again. I also made certain that Undo works with it too, and Save. Below is an example of what it can do now. Also in the attachments is the new zip file with all the needed files. This time it's not only a new .bas file but also another .png color wheel that I added to choose your text color.



 

Offline Dav

  • Forum Regular
  • Posts: 237
Re: Paint Pixels 8 With Right-Click Menu
« Reply #26 on: July 03, 2020, 11:00:16 PM »
That did it, Ken.  Great.  The gibberish is gone.  And good eye, Steve! 

Text is working fine for me here.  It's a nice addition.  Played around with it some.  I have to hit the sack now - I'll pick it up again tomorrow and test it more.

- Dav

 

Offline SierraKen

  • Forum Resident
  • Posts: 943
Re: Paint Pixels 8 With Right-Click Menu
« Reply #27 on: July 03, 2020, 11:06:05 PM »
Wow, awesome picture! Thanks again for the help!

Offline bplus

  • Forum Resident
  • Posts: 4564
  • B+ nots
Re: Paint Pixels 8 With Right-Click Menu
« Reply #28 on: July 04, 2020, 11:33:43 AM »
Hey looks like the start of a Icon or Logo for the app! Red Green Blue: PP8

@Dav might be in a position to quit his day job ✨

Offline Dav

  • Forum Regular
  • Posts: 237
Re: Paint Pixels 8 With Right-Click Menu
« Reply #29 on: July 04, 2020, 01:14:10 PM »
Lol @bplus. My day job quit me in March thanks to the virus.  But it's starting to come back a little bit, been playing outdoor concerts for places that will let me.

@SierraKen, Looks like there is still some crash issues.  I've been giving PP8 a hard test this morning.  I never have a crash using Draw, Erase, fill-in - but lines, boxes and circles will still occasionally crash when used a lot.   I also encountered a memory error once which terminated the program.   Also, once when using boxes the program just froze up and the mouse pointer turned to the 'waiting' icon.  Had to task kill it to end program.  It seems the crashing starts after a while into the work, not at the beginning of using the program.

- Dav