To find out why it isn't working, you need to know what the error is.. rather than simply ignoring it as you are doing. I realise that it is a useful thing to do for a 'live' application, but it stops you from finding problems when debugging.
Remove (or comment out) the On Error line so that you see the error message, and the line that causes the problem.
I've just realised another issue, which your latest problem is a symptom of.. you are using PicFrom.Height/Width (which are measured in the Form's scale), whereas you should be using the Scale versions (eg: PicFrom.ScaleHeight) which are the internal dimensions (so the same as the picture that is shown) measured in the ScaleMode of the control itself.
Ok, I've taken just the parts of the program needed to re-create the problem and am uploading the project.
Basically it's capturing the portion of the image below picBlended and using two more pictureboxes to add text to it.
You can drag and drop picBlended to different areas and hit the 'Go' button again to re-blend the images.
The actual program does more, but this is enough to show the problem.
ALSO, I don't know why, but 'Sub SetSize()' doesn't get the scaling right the 1st time.
But after the second time it's called it works fine, so you'll have to clcick the button twice on the 1st try.
Any ideas what's happening there?
------------
just removed the incomplete project
Last edited by longwolf; Jan 10th, 2007 at 02:56 PM.
The problem with SetSize is again due to Height being in the ScaleMode of the parent, which in this case is picMain (and gets changed in CapBackground). The way to deal with this is to get the size in the correct scale, which you can do using ScaleX and ScaleY, eg:
In FlipImage you need to have the Scale versions (with .Picture), otherwise (despite what you think) it doesn't work. If you use the non-scale versions, only a tiny square in the corner (which is the size you specified) gets modified.
As you are flipping it twice you can't see the actual problem - which is that the text is getting erased. To see this either step thu the code, or add a MsgBox before and after the calls to FlipImage (in SetText).
I'm afraid I can't remember right now how to persist drawn items (such as text) on a picturebox.. and have to go out soon.
Ah yes, silly me.. I should have remembered that one!
You never need to swap ScaleMode - as you can ask for values in the scale you want by using ScaleX and ScaleY, eg:
WOW, you typed a mouthful
Thx again.
But I do think you have to change to vbPixels for several of the API methods.