Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating mask & using it

Status
Not open for further replies.

slowATthought

Programmer
Dec 2, 2003
56
US
I am trying to make an image as a mask during runtime, and then store it in a picture box. Then I try drawing it with the PaintPicture function, but it won't accept it. I investigated further, and I found that it won't draw any picture setup through code, but if you load it during runtime, it works. (however I can't load the mask I need beforehand, because I still need to make it)

thanks
 
>it won't draw any picture setup through code

Sure it will. You just need to know how. Thing is it might not be the best approach...

I think the best thing might be if you gather all your various threads on this subject into one place, and explain what it is you are trying to achieve and what you have tried so far so we can help better.
 
All right. I actually tried asking this at the end of my last post, but nobody answered.... This was the only other thread:

thread222-720475
 
Form with three picture boxes, one command button:

Option Explicit

Private Sub Command1_Click()
Picture1.AutoRedraw = True
Picture1.Line (100, 100)-(500, 500), vbWhite, BF
Picture1.AutoRedraw = False

Set Picture2.Picture = Picture1.Image ' retrieve persistent image

Picture3.PaintPicture Picture2, 0, 0
End Sub
 
I have to draw the image over and over again to create animation, and I have found that that is where the error happens. If I draw it in a place that is called more than once in a while, it won't work.
 
As I said, it might be better if you try and explain what it is you are actually trying to achieve, rather than telling us - out-of-context - what doesn't work.

For example, you originally seemed to be telling us that PaintPicture did not work when used on a run-time created image, but now you seem to be saying that the problem actually occurs if you try redrawing 'more than once in a while'.

It is difficult for us to help if we don't clearly understand the problem.
 
Oh... I figured it out. Intead of:

Picture3.PaintPicture Picture2, 0, 0

I needed to do this:

Picture3.PaintPicture Picture2.Image, 0, 0

Sorry for all the confusion. This was a really strange question, but I think I understand what to do now. Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top