In principle, you are right. But the image you write to has the size of the screen, not of the image you want to show, and that's your problem here. You better write to an image that has the correct size and then copy it on the screen. Nonetheless I would recommend to keep the ScreenSet/ScreenCopy method to avoid flicker.Daniel Ouellette wrote:With "ScreenSet 1.0", I thought I was writing first on a image instead of the screen. Can you explain how?
[solved] GET and PUT ( graphics ) commands slow down my program[solved]
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: GET and PUT ( graphics ) commands slow down my program
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
I'm sorry, I don't understand anymore!
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
I answered too quickly!
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
So it's okay the way I did it?grindstone wrote: In principle, you are right. But the image you write to has the size of the screen, not of the image you want to show, and that's your problem here. You better write to an image that has the correct size and then copy it on the screen. Nonetheless I would recommend to keep the ScreenSet/ScreenCopy method to avoid flicker.
Re: GET and PUT ( graphics ) commands slow down my program
PSET, PRESET, LINE, CIRCLE, DRAW, DRAW STRING and PAINT can directly draw to an image buffer (see documentation).Daniel Ouellette wrote:How to do this ?fxm wrote:Can you directly draw the image in an image buffer (1024x768) and not on the screen (no longer using GET), then just PUT the image on the screen center (by using one only screen page, without ScreenSet, neither CLS, neither FLIP).
Then, only use PUT to copy the image buffer to the screen center.
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: GET and PUT ( graphics ) commands slow down my program
Seems we are a bit asynchronous. *grin*Daniel Ouellette wrote:So with ScreenSet and GET?grindstone wrote:If the image is composed of multiple parts it's maybe better to do it invisible in the background.
With ScreenSet, but without GET. Have a look at the snippet I posted. Set up the image you want to show the way you did before, but write it to the image I called "img5" instead to the screen. Place this code between the "'#######..." lines and delete the "Circle.." line (it was only to demonstrate that the image is updated periodically). It should work then.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
I will try and tomorrow I will come back with this, thanks to you and the others.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
I had some time and I realized that I was far from the electronics I do. This program that I did in Freebasic is very long, maybe too long, and was done with a bit of everything without worrying about the follow up, like a beginner. I'm going to have to rework everything so that it's only in graphics, so that I can do everything in an image buffer instead of a screen, so that I can forget about the GET command. In fact, many commands cannot currently be used with a target buffer, such as PRINT. So I'll have to keep GET for now and modify another version of the program in my spare time.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
So, unless there's something else to replace the GET command for faster execution, I think that's conclusive, if you agree
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: GET and PUT ( graphics ) commands slow down my program
I don't know how many others know or guessed what you are trying to do but I can't figure it out to say yes or no to anything you wrote.
I never found the need to use GET when using images.
You mention using PRINT so I wondered if using draw string might be another option.
I never found the need to use GET when using images.
You mention using PRINT so I wondered if using draw string might be another option.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
Yes, I'm actually going to change everything to just be in graphics commands like using Draw String instead of Print, it's that like a beginner I used both and that for a lot of other commands, I mixed it all up. So the best thing is to make a better version of this program which will take a lot of time. For now, I will keep the GET for the current version.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
I studied electronics and assembler language at a time when PCs and high-level languages did not exist. I learned on my own with QB and I never needed to excel in PC computer languages because it wasn't necessary in my job to design electronic devices with microcontrollers, it may seem unthinkable nowadays, but it really is the case. The electronic devices I design don't need PCs to work, even if I use them to work.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
In fact, at the beginning, I was programming directly in machine code and the assembler came afterwards.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
At first glance, it may seem that I didn't evolve along with computer language. But, with microcontrollers, I have always favoured assembler and machine code to keep control of the compilation. This allowed me to analyse an analog signal of more than 50K points, its frequency decomposition in real time, the application of computer filters and much more in 200mS.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: GET and PUT ( graphics ) commands slow down my program
Hi everyone, about my last message, it's out of the Freebasic context, I'm more microcontroller than PC and we can't compare them in terms of performance, they're completely different environments. I just wanted to say that my skills are more at the microcontroller level than at the PC level, you surely noticed it in relation to my lack of knowledge for PCs.