Load a picture in a picture control 
Author Message
 Load a picture in a picture control

I am kind of confused. I tried to do that by setting the picture property of
a
picture object to
app.path+"\pic1.jpg"
but I get the error "Type mismatch". What am I doing wrong ?


Sun, 17 Aug 2003 23:07:02 GMT  
 Load a picture in a picture control


Quote:
> I am kind of confused. I tried to do that by setting the picture property
> of a picture object to app.path+"\pic1.jpg"
> but I get the error "Type mismatch". What am I doing wrong ?

You're probably missing out the LoadPicture keyword. Try:

Picture1.Picture = LoadPicture(App.Path + "\pic1.jpg")

Mike



Sun, 17 Aug 2003 23:20:28 GMT  
 Load a picture in a picture control



Quote:



> > I am kind of confused. I tried to do that by setting the picture
property
> > of a picture object to app.path+"\pic1.jpg"
> > but I get the error "Type mismatch". What am I doing wrong ?

> You're probably missing out the LoadPicture keyword. Try:

> Picture1.Picture = LoadPicture(App.Path + "\pic1.jpg")

> Mike

Right.

The logic here is that the picture property refers to an OLE object, not to
a string. It's confusing because the design time property window accepts the
string to point to the file location.

Although I'm not an expert myself, I think it is advisable for not to fresh
newbie's to try to explore the object browser. You'll see how things  are
composed.

Bas.



Mon, 18 Aug 2003 06:00:08 GMT  
 Load a picture in a picture control

Quote:
> Right.

> The logic here is that the picture property refers to an OLE object, not to
> a string. It's confusing because the design time property window accepts the
> string to point to the file location.

that's not true, even in design time it is not a string but an OLE object. When
you select a picture at design time VB automatically loads the picture, it is later
saved in the form's .frx file.

Regards, Florian

Quote:

> Although I'm not an expert myself, I think it is advisable for not to fresh
> newbie's to try to explore the object browser. You'll see how things  are
> composed.

> Bas.



Mon, 18 Aug 2003 19:46:06 GMT  
 Load a picture in a picture control



Quote:

> that's not true, even in design time it is not a string but an OLE object.
When
> you select a picture at design time VB automatically loads the picture, it
is later
> saved in the form's .frx file.

> Regards, Florian

I agree with you, but what I meant to say was that from the property window
you cannot tell it's an OLE object.

Regards, Bas.



Tue, 19 Aug 2003 01:25:15 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Loading two pictures into one picture control query?

2. Fast-loading Pictures to Picture Boxes?

3. Transparant pictures loading in a picture box

4. How do I load .jpg pictures into picture boxes in VB 4.0

5. Copy a picture from a Picture Control in a Image Control

6. Copy gif and jpg file in picture control to picture control

7. Copy gif and jpg file in picture control to picture control

8. Copy gif and jpg file in picture control to picture control

9. Copy gif and jpg file in picture control to picture control

10. Images Controls that load picture from a recordset without Data Control

11. Images Controls that load picture from a recordset without Data Control

12. Load a picture in a control from a recordset without use Data Control

 

 
Powered by phpBB® Forum Software