WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Selecting an area of the screen for a screenshot using your mouse  (Read 35351 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #60 on: August 06, 2018, 12:11:24 AM »
Hi aus9
Everything looks good.

Code: [Select]
grabber.c: In function ‘main’:
grabber.c:588:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
 int main(int argc, char *argv[])
              ^~~~
The first warning is because my program doesn't take any command line parameters, so I don't use  argc.

Code: [Select]
grabber.c:817:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
      status|=KILLALL;
            ^
grabber.c:818:6: note: here
      case XK_q: // ****** Quit current instance program
      ^~~~
grabber.c:854:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      AddCursor();
      ^~~~~~~~~~~
grabber.c:855:6: note: here
      case XK_s: // ****** Save an image
As far as these 2 warnings are concerned, those statements will most definitely fall through, because I want them to. ;D

aus9

  • Guest
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #61 on: August 06, 2018, 12:27:26 AM »
sorry I  deleted my post as I wanted to clear some things up. Thanks for the heads up

am in the process of trying out a few things because I should have done it earlier.

edit Rich replied and the main parts of his reply refer to this
Code: [Select]
gcc  $CFLAGS -Wall -Wextra -fwhole-program -c $P.c -g
grabber.c: In function ‘main’:
grabber.c:588:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
 int main(int argc, char *argv[])
              ^~~~
grabber.c:817:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
      status|=KILLALL;
            ^
grabber.c:818:6: note: here
      case XK_q: // ****** Quit current instance program
      ^~~~
grabber.c:854:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      AddCursor();
      ^~~~~~~~~~~
grabber.c:855:6: note: here
      case XK_s: // ****** Save an image

gcc $CXX -I. -L. $P.o -o exe -lImlib2 -lX11 -lXfixes
# no output

but I saw I had not used $CXX in my first post which I deleted so was hoping he had not seen it, so I could try out some stuff.
more later
« Last Edit: August 06, 2018, 12:36:16 AM by aus9 »

aus9

  • Guest
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #62 on: August 06, 2018, 04:03:01 AM »
ok clean build and rebooted into xbase.lst, my dep has only libXfixes as imlib2 stuff is there.
but I deleted my post when I realized that I had not correctly put my CXX flags into the build bit

so here is that aspect.

Code: [Select]
CFLAGS="-mtune=generic -Os -pipe"
CXX="-flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti"
P=grabber
snip
gcc  $CFLAGS -Wall -Wextra -fwhole-program -c $P.c -g
gcc $CXX -I. -L. $P.o -o exe -lImlib2 -lX11 -lXfixes

second last line as discussed....works the same as above and you have already allayed my concerns on that issue.

bottom line builds the exe and my build script creates TCZ etc

Test with xbase.lst is a pass for a full screenshot. Pass for a selection too.
I am inviting another member to have a look at something unrelated to above so hope you don't mind me attaching the build script.

the download gsource was only created because I did not want to try to work out how to use your attachment in my script as I lacked the skills.

will let you know if I have had any feedback from that other member later

thanks

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #63 on: August 06, 2018, 11:53:27 PM »
Hi aus9
I removed the source package from the other thread and am reposting it here. I also renamed the file to reflect its
current version number, the contents are unchanged.

aus9

  • Guest
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #64 on: August 07, 2018, 01:34:14 AM »
Rich

right, no change still v 1.2

thanks

aus9

  • Guest
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #65 on: August 17, 2018, 09:18:38 PM »
Rich

your creation has landed in 64 bit Repo
Your c, h and png files are in a compressed package called grabber-src-files.tcz
http://repo.tinycorelinux.net/9.x/x86_64/tcz/src/grabber/

thanks
« Last Edit: August 17, 2018, 09:38:49 PM by aus9 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #66 on: August 17, 2018, 09:43:01 PM »
Hi aus9
Is  imlib2  part of a base install in x86_64? If not, then  imlib2.tcz  needs to be added to  grabber.tcz.dep.

aus9

  • Guest
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #67 on: August 17, 2018, 11:07:46 PM »
Rich

imlib2-bin and imlib2 are already in xbase.lst

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #68 on: August 17, 2018, 11:12:05 PM »
Hi aus9
OK, just checking because as of TC5  imlib2  was removed from base in x86.

Offline Pats

  • Sr. Member
  • ****
  • Posts: 322
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #69 on: August 17, 2018, 11:46:29 PM »
Generally "import" coomand can be used to capture part of the screen.
It would be desirable, if grabber can be used to capture irregular area on the screen displaying an image with a facility to reverse the pixel  colors from black to white and vice-versa etc within selected irregular area with click of a mouse button, if posible !  :)
By the way, nice efforts for grabber !

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #70 on: August 18, 2018, 07:43:11 AM »
dep file adjusted

aus9

  • Guest
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #71 on: August 18, 2018, 06:38:12 PM »
now I am confused. I thought if a dep was already in xbase.lst I did not need it for the TCZ dep?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #72 on: August 19, 2018, 03:27:19 AM »
I don't recall that being said?

aus9

  • Guest
Re: Selecting an area of the screen for a screenshot using your mouse
« Reply #73 on: August 19, 2018, 04:56:04 AM »
ahh well I get easiy confused ;)