Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PictureVal good choice is not one.
Message
 
 
To
09/06/2004 07:26:25
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00911037
Message ID:
00911940
Views:
17
>
>The way the new PictureVal stuff works is that we internally assign each image to a resource. And that resource must be referenced by a unique variable (or property reference).
>

>It is not clear:
>Into a table blob i have one reference and many images.
>How many resources alloc VFP9?
>
>-  1
>- COUNT(DISTINC blobField)
>- COUNT(blobField)
>
>
>
>Once that reference is released, we release the internal resource for that image (otherwise, Visual FoxPro could end up consumming huge amounts of memory).
>

>
>See my following code, i think it not consuming huge amouts of memory.
>
>
> For the behavior you desire, you would need to come up with a unique reference (e.g., array) for each different image you wanted to display in the grid. Hope this helps.
>
>Randy
>

>
>This is similar to create an Array of image objects with everyone its Picture ?
>
>*****
>
>Hovewer, i have found a way for implement a Image with ControlSource and dynamic paint into a grid, row by row.
>
>I try it without problem into VFP9.
>Of course the speed is not incredible, but PictureVal is 4x faster
>respect to Picture, and for little icons
>
>
>You can run this with attention ?
>

>PUBLIC oform1
>
>oform1 = CREATEOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
> DoCreate = .T.
> Caption = "A demo for Images into a grid"
>
> ADD OBJECT grid1 AS grid WITH Height = m.thisForm.Height - 8 ;
> , Left = 4 ;
> , Top = 4 ;
> , Width = m.thisForm.width - 8 ;
> , ColumnCount = 0 ;
> , Anchor = 1+2+4+8
>
>
> PROCEDURE Load
>
> CREATE CURSOR myCursor (blobImage W)
>
> CD HOME(4)+"\Bitmaps\Assorted"
>
> PRIVATE aBmpFiles
> FOR k=1 TO ADIR(aBmpFiles,'*.bmp')
> INSERT INTO (ALIAS()) VALUES (FILETOSTR(m.aBmpFiles[m.k,1]))
> NEXT
> GO TOP
> CD HOME(0)
> ENDPROC
>
> PROCEDURE grid1.Init
> this.AddObject('imageColumn','imageColumn')
> WITH m.this.imageColumn
> .rowImage._Controlsource = m.this.RecordSource+"."+FIELD(1,m.this.RecordSource)
> .Visible = .T.
> ENDWITH
> ENDPROC
>
>ENDDEFINE
>
>DEFINE CLASS imageColumn AS Column
> Bound = .F.
> Sparse = .F.
>
> ADD OBJECT rowImage AS rowImage
>
>ENDDEFINE
>
>**************************************************
>*-- Sketch Class : rowImage
>*
>
>DEFINE CLASS rowImage AS image
> BackStyle = 0
> Stretch = 1 && is it a big job for VFPT to add a Centered option ( no fit, only draw center into Image area ) ?
> _Controlsource = "''"
>
> PROCEDURE backstyle_access
> this.PictureVal = EVALUATE(m.this._ControlSource)
> RETURN m.THIS.BackStyle
> ENDPROC
>
>ENDDEFINE
>

>
>You can comment it ?
>I think VFP release internal resource for every PictureVal reassign.
>
>*******************************************
>
>P.S. Randy, i use a best implementation for myAnchor into my VFP8
>( this does not demand many modifications on VFP9 C++ code ),
>if I adapt it to VFP9 and send to you a explained demo via email,
>you take it in consideration, or the VFP9 is frozen and therefore I lose alone time ?
>If VFPT not changed Anchor,
>I must keep the myAnchor of VFP8 adapted to VFP9, and VFP community opportunity loses one.
>
>Fabio

Nice solution for embedding PictureVal images in a grid. Very Cool! BTW, we don't plan to change our implementation of the Anchor property. But thanks anyway for your feedback on this.

Randy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform