Saving a patch of screen

BlitzPlus Forums/BlitzPlus Programming/Saving a patch of screen

julianbury(Posted 2008) [#1]
Hi, Good People :-)

I am trying to write a picture gallery, using BlitzPlus.
I need to quote a square patch from the middle of a picture to use as a link to the full-size picture.

The full size is 800px wide and the square patch is to be 200px wide.

Assuming the full picture is loaded at the top-left of the screen, the patch would be:
top-left: 300x200
bottom-right: 500x400

What command would save that bit of screen?

Thank you for any help you can offer :-)

Julian (-_-)


Snarkbait(Posted 2008) [#2]
GrabImage - see docs


julianbury(Posted 2008) [#3]
Thank you Snarkbait
Going to try it now :-)


julianbury(Posted 2008) [#4]
I have spent hours trying to make this work.
It should display a picture and save a quote from it.
It keeps halting DrawImage(pic, 0, 0) saying that pic is invalid.
What am I doing wrong?


xres=GadgetWidth(Desktop())
yres=GadgetHeight(Desktop())

Graphics xres, yres
SetBuffer FrontBuffer()

sorc$=CurrentDir$()+"big"
dest$=CurrentDir$()+"small"

grab=CreateImage(200,200)
pic=0
csd=sorc$

Repeat
file$=NextFile$(csd)
If Len(file$)>4
pic=LoadImage(file$)
Cls
DrawImage(pic, 0, 0)
Delay 100
tmp$=Left(file$,Len(file$)-4)
GrabImage grab,300,200
ok=SaveBuffer(FrontBuffer(),dest$+tmp$+".bmp")
FreeImage(pic)
EndIf
Until file$=""

Notify "DONE"
End


Snarkbait(Posted 2008) [#5]
You must not be referencing the filename properly

looks like it should be

csd = ReadDir(sorc$)


Senzak(Posted 2008) [#6]
Yes, with your current assignment
csd=sorc$

csd is an integer variable, so its value becomes 0