Page 1 of 1

graphic clipboard

Posted: Sat Dec 05, 2015 3:12 pm
by pasbel
Hi
What is the better way to make a graphic clipboard ?
In my program, I open dialog-like box for information, and when I quit this dialog, I redraw all screen, I think it's not the best way for speed.
I wish to put dialog zone before to see it in a "clipboard", to redraw only this zone after quit my dialog to improve speed

Re: graphic clipboard

Posted: Thu Dec 10, 2015 11:29 pm
by pasbel
Best code I did :

before draw rectangle :

Code: Select all

rectangle_buffer = new( rectangle_sizex , rectangle_sizey , INT )
clean( rectangle_buffer, -1 )
	
loop_y = 0
while ( loop_y < rectangle_sizey ){
	loop_x = 0
	while ( loop_x < rectangle_sizex ){
		rectangle_buffer [ loop_x , loop_y ] = get_dot( rectangle_posx + loop_x , rectangle_posy + loop_y )
		loop_x = loop_x + 1
	}//end while
	loop_y = loop_y + 1
}//end while
Then I draw my picture :

Code: Select all

fbox ( rectangle_posx , rectangle_posy ,rectangle_sizex , rectangle_sizey , rectangle_fill )
frame( 0 ,  rectangle_posx ,  rectangle_posy ,  rectangle_sizex ,  rectangle_sizey )
To delete my picture, I redraw buffer :

Code: Select all

loop_y = 0
while ( loop_y < rectangle_sizey ){
	loop_x = 0
	while ( loop_x < rectangle_sizex ){
		dot( rectangle_posx + loop_x , rectangle_posy + loop_y , rectangle_buffer [ loop_x , loop_y ] )
		loop_x = loop_x + 1
	}//end while
	loop_y = loop_y + 1
}//end while
frame( 0 ,  rectangle_posx ,  rectangle_posy ,  rectangle_sizex ,  rectangle_sizey )
remove(rectangle_buffer )

Re: graphic clipboard

Posted: Tue Jan 05, 2016 10:47 am
by DigitalNematode
I don't have anything to share with you regarding this. But every little bit helps. So I'm thanking you for what you shared. :) EDIT > I learn by example and I hate asking questions :/ Arn't enough, or haven't seen enough project files to make complete sense of it. So far I can swap in my track... change images... Its the placement, adjustment... Ahhhhh. :/ I'll figure it out... Eventually. Thanks again.

Re: graphic clipboard

Posted: Tue Jan 05, 2016 12:35 pm
by pasbel
just like me...

Image

Re: graphic clipboard

Posted: Tue Jan 05, 2016 7:11 pm
by iaon
Is there another language most similar in syntax to pixilang, so that some programming principles can be learned analogously?
(Getting off topic, I realize...)

Re: graphic clipboard

Posted: Tue Jan 05, 2016 8:32 pm
by pasbel
python, processing but I think they need some additionnal library for MIDI, sound synthesis,...
There is some basic language too but it's difficult too to make MIDI...

I work to make a graphic interface for use with my future project, I wish to use pixilang with ITX mini board with Windows or Linux
http://www.dr-midik.fr/pixilang/midi_se ... -12-05.zip