Author Topic: Paint Pixels 7 With JPG Saves And No Gaps In Drawing And Thicker Drawing!  (Read 888 times)

Offline SierraKen

  • Forum Resident
  • Posts: 950
Here is the fixed version in its own zip file with the 4 needed libraries.

 
Update: Huge memory issue found, please delete this version if you have it. Zip file has been removed.

« Last Edit: July 04, 2020, 05:22:21 PM by SierraKen »

Offline bplus

  • Forum Resident
  • Posts: 4589
  • B+ nots
And still the prettier old Color Dialog!

Offline SpriggsySpriggs

  • Seasoned Forum Regular
  • Posts: 259
  • DIM JohnSilver AS LONG, yarn AS STRING
    • My GitHub
@SierraKen I apologize, you are correct. The extension is not attached in 64 bit. I got it to work in 32 bit. This just tells me there is something wrong in a variable size in the 64 bit that Petr and I have been using. I'll have to fiddle around with variable types in the 64 bit type and see what makes it finally click. Thank you for letting me know about this! The issue is with nFilterIndex. In 32 bit, it returns the index of the selected extension, allowing it to be found and added automatically. In 64 bit, there is a variable type issue somewhere and it is causing it to return 4.7E whatever which is obviously not an index in the filter. I'll check this out in the coming week and keep changing variable types until something hits.
« Last Edit: June 28, 2020, 02:02:52 AM by SpriggsySpriggs »

Offline SierraKen

  • Forum Resident
  • Posts: 950
Welcome Spriggsy, am always glad I can help.

Late tonight I added something fun that B+ gave me the idea for, different background colors to start out with. I didn't use any color picker, just a list of 9 common colors to choose from. The picture below doesn't have one of the chosen backgrounds (I accidentally did Fill on the whole sky LOL). But it's very similar.


Update: Huge memory issue found, please delete this version if you have it. Zip file has been removed.


« Last Edit: July 04, 2020, 05:22:38 PM by SierraKen »

Offline SierraKen

  • Forum Resident
  • Posts: 950
The next Paint Pixels update is coming soon. It will have a color wheel of 170 different colors and shades to choose the background color. It uses a graphic file that is loaded to the screen and the POINT command to choose the color. I'm still going to use the color picker sliders that B+ made for the paint color. The update will also have the ability to save your graphic as JPG, PNG, or BMP files, thanks to Petr's work on the open and save libraries.
« Last Edit: June 28, 2020, 06:47:16 PM by SierraKen »

Offline Petr

  • Forum Resident
  • Posts: 1354
  • The best code is the DNA of the hops.
You can also add a GIF option. Steve's library can do that, too.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2594
    • Steve’s QB64 Archive Forum
You can also add a GIF option. Steve's library can do that, too.

And, if we ever expand _LOADIMAGE to work with other formats, I'll probably expand SaveImage to work with those formats also.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SierraKen

  • Forum Resident
  • Posts: 950
I just now tried to add GIF and got an error message for the library. This is what I got:

Line: 1539 (in saveimage.bm) Subscript out of range. Continue?

It happened as soon as I tried to save an image to GIF. The dialogue window opened fine though. Here is my dialogue script:

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

It saves a JPG right though. But I just checked my folder and it saves some of the GIF image but not the complete image.
« Last Edit: June 28, 2020, 08:13:20 PM by SierraKen »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2594
    • Steve’s QB64 Archive Forum
I'll dig into it tomorrow and see what's going on.  Which version of the library are you using, so I know which line to look at for that subscript error.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SierraKen

  • Forum Resident
  • Posts: 950
I'm using these... I don't know if they are out of date or what. I've had them for awhile. I'll put them in attachments. Thanks for your help Steve.


Offline Petr

  • Forum Resident
  • Posts: 1354
  • The best code is the DNA of the hops.
Quote
I just now tried to add GIF and got an error message for the library. This is what I got:

Line: 1539 (in saveimage.bm) Subscript out of range. Continue?

It happened as soon as I tried to save an image to GIF. The dialogue window opened fine though. Here is my dialogue script:


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

This section, which you mention, has nothing to do with the SaveImage library. This section only returns the path to the file.

Try use:
Code: QB64: [Select]
  1. Result = SaveImage(nm$, 0, 0, 0, _WIDTH-1, _HEIGHT-1)
  2.  

Can you also post here, how is writed this row in your current program?

Result = SaveImage...

I use newerest SaveImage library + opensave library and no problem, when saving image as GIF.
« Last Edit: June 29, 2020, 06:01:41 AM by Petr »

Offline SierraKen

  • Forum Resident
  • Posts: 950
Thanks Petr, I found your newest SaveImage libraries on the other forum thread and those seem to work fine. One thing you should know is that if you use the  _WIDTH - 1, _HEIGHT - 1 like you said, the outcome doesn't look smooth at all, it's a bit crunched up on the lines. So I used this:

Code: QB64: [Select]
  1. Result = SaveImage(nm$, 0, 0, 0, _WIDTH(img), _HEIGHT(img)) 'first zero is your screen, second zero is X start, 3th zero is y start
  2.  

Don't ask me what the (img) is from, might be something b+ did almost a year ago for an example or something, but for some weird reason it works better than not using it I think.
But yes, the SaveImage 2.3b works just fine now. Steve, there's no need to fix my problem with it I believe.
Also, I think I fixed the _TITLE text getting inside the Save dialog box list, although it might still show up every once in awhile. It's not a big problem since most people won't try to save their picture as a bunch of strange letters as the extension LOL.
I'll post the newest update in a minute, it has lots of goodies I've been adding. :)))


Offline SierraKen

  • Forum Resident
  • Posts: 950
OK, here is the big (and probably last for version 7) update. I will re-post all of what I did for version 7 below. But I just want to say thank you everyone for all your help. I couldn't have done this without you. Today and yesterday I added GIF support, 170 different background colors to choose from using a color wheel graphic, user defined screen sizes (as well as the regular sizes), and an Undo feature. The Undo feature lets people remove their last action on the picture they make. More information on how to use it is on the front page.
The updated zip file with all the needed files is below in attachments. As well as a simple .png house using fill-in and ray lines.

Here is all of the additions I have made on version 7:

Changed from just bmp pictures to jpg, png, gif, and bmp pictures.
Fixed the Drawing so that there's no gaps.
Fixed the Erasing so that there's no gaps.
Deleted tiny dot in center of orbits when turning them off.
Added different sizes of screens to select from.
Removed sounds.
Changed antique way of saving and opening to Windows Open and Save File Dialog.
Made Ray lines thicker.
Added the ability to see instructions without picture being lost.
Added 170 different background colors to choose from on a color wheel.
Minor fixes.
Thank you to B+ for the Fill-In code!
Thank you Petr, B+, and SpriggySpriggs for the help and examples for Open and Save File Dialog.
Added Undo feature.
Added User Defined Screen Size.


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

Offline SierraKen

  • Forum Resident
  • Posts: 950
I just fixed a small problem. A few days ago I changed the eraser to white whenever someone loaded a new picture with it. But I forgot to not change it white when someone just clicks Cancel on the open dialog. So it's fixed now and uploaded above in the zip file.