Syntax for loading a picture (easy) 
Author Message
 Syntax for loading a picture (easy)

Is it better to use

picture1.picture = Loadpicture
OR
picture1= loadpicture

Also, I've notice that when referring to a picture on another form, that you
HAVE to reference the .picture property in order to assign a graphic.  Why?

Thanks,
Bodi Klamph
Azure Dragon Software

begin 666 Bodi Klamph.vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..DML86UP:#M";V1I#0I&3CI"
M;V1I($ML86UP: T*14U!24P[4%)%1CM)3E1%4DY%5#I"2VQA;7!H0$%Z=7)E

`
end



Thu, 09 Nov 2000 03:00:00 GMT  
 Syntax for loading a picture (easy)

It's always faster not to reference a default property explicitly.  Thus
picture1=loadpicture will execute more quickly but is possibly slightly less
self-documenting than picture1.picture=loadpicture

Quote:

>Is it better to use

>picture1.picture = Loadpicture
>OR
>picture1= loadpicture

>Also, I've notice that when referring to a picture on another form, that
you
>HAVE to reference the .picture property in order to assign a graphic.  Why?

>Thanks,
>Bodi Klamph
>Azure Dragon Software



Fri, 10 Nov 2000 03:00:00 GMT  
 Syntax for loading a picture (easy)

Adam,

Is there documentation on this? I would have though that using default
properties would be slower...

Matthew



Quote:
> It's always faster not to reference a default property explicitly.  Thus
> picture1=loadpicture will execute more quickly but is possibly slightly
less
> self-documenting than picture1.picture=loadpicture


> >Is it better to use

> >picture1.picture = Loadpicture
> >OR
> >picture1= loadpicture

> >Also, I've notice that when referring to a picture on another form, that
> you
> >HAVE to reference the .picture property in order to assign a graphic.
Why?

> >Thanks,
> >Bodi Klamph
> >Azure Dragon Software



Fri, 10 Nov 2000 03:00:00 GMT  
 Syntax for loading a picture (easy)

The best source I've found for this kind of useful performance information
is {*filter*} VB5 by Bruce McKinney.  He doesn't do exhaustive testing but he
does pick things that are actually useful to the typical developer.

As far as the default property is concerned, VB doesn't need to reference
anything to access the default property which makes it faster although as I
mentioned in my last post, it's a trade-off between speed and readability.
In 99% of cases I'd doubt that the speed advantage is significant enough to
sacrifice the readability of the code.



Sat, 11 Nov 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Load a picture in a picture control

2. Fast-loading Pictures to Picture Boxes?

3. Loading two pictures into one picture control query?

4. Transparant pictures loading in a picture box

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

6. easy question - date function syntax?

7. Easy SQL Syntax Question

8. easy question on syntax

9. Easy SQL Syntax Question

10. VBscript syntax (easy question)

11. Easy SQL Syntax Question

12. Easy SQL Syntax Question

 

 
Powered by phpBB® Forum Software