Displaying images stored in Blob in a browse window 
Author Message
 Displaying images stored in Blob in a browse window
In a browse window I'd like to display images stored in a blob. While
browsing, the images need to be refreshed. Can someone help me with some
example source?
(using CW 2.003)

Adri Rots



Mon, 10 Mar 2003 03:00:00 GMT  
 Displaying images stored in Blob in a browse window

Quote:

>In a browse window I'd like to display images stored in a blob. While
>browsing, the images need to be refreshed. Can someone help me with some
>example source?
>(using CW 2.003)

Hi Adri,

Just figured out how to do this today. Thing is, blobs are not treated
as regular fields and can't be made "hot" in a browse. So what you
have to do is make hot fields of the elements of a key for your
"blobbed" file, and then do a get in the "New Selection" embed point
for that browse using that key.

For instance, if the file has a key called "KeyID" consisting of one
field called "ID", then you would make the field "ID" a hot field, and
place the following statement in the "New Selection" embed...

GET( MyFile, KeyID)

HTH

b. rgds.
Richard (The Sylkie)
Oslo

Calm down folks...it's all just 0's and 1's.



Mon, 10 Mar 2003 03:00:00 GMT  
 Displaying images stored in Blob in a browse window
Thanks Richard.

I tried it and it works fine.

Richard Rogers schreef:

Quote:

> >In a browse window I'd like to display images stored in a blob. While
> >browsing, the images need to be refreshed. Can someone help me with some
> >example source?
> >(using CW 2.003)

> Hi Adri,

> Just figured out how to do this today. Thing is, blobs are not treated
> as regular fields and can't be made "hot" in a browse. So what you
> have to do is make hot fields of the elements of a key for your
> "blobbed" file, and then do a get in the "New Selection" embed point
> for that browse using that key.

> For instance, if the file has a key called "KeyID" consisting of one
> field called "ID", then you would make the field "ID" a hot field, and
> place the following statement in the "New Selection" embed...

> GET( MyFile, KeyID)

> HTH

> b. rgds.
> Richard (The Sylkie)
> Oslo

> Calm down folks...it's all just 0's and 1's.



Mon, 10 Mar 2003 03:00:00 GMT  
 Displaying images stored in Blob in a browse window

Quote:

>Thanks Richard.

>I tried it and it works fine.

>Richard Rogers schreef:


>> >In a browse window I'd like to display images stored in a blob. While
>> >browsing, the images need to be refreshed. Can someone help me with some
>> >example source?
>> >(using CW 2.003)

Hi Adri,

Good. In response to your other question, look at PROP:Noheight and
PROP:NoWidth. If you stuff an image with a bitmap and then get the
height and width, you will get the height and width of the image
control, not the bitmap. Wacky huh?

Instead, set PROP:NoHeight to true, PROP:Nowidth to true, and then
stuff the bitmap in the image. Now if you query the image you will get
the height and width of the actual bitmap and can calculate the aspect
ratio. Hide the image before doing all this, and unhide it after in
order to avoid weird stuff all over your screen.

Good Luck,

b. rgds.
Richard (The Sylkie)
Oslo

Calm down folks...it's all just 0's and 1's.



Mon, 10 Mar 2003 03:00:00 GMT  
 Displaying images stored in Blob in a browse window
Hi adri, to complete, try this code :

  M# = 10   ! Marging
  L# = Window{Prop:Width}  - M# ! Max width
  H# = Window{Prop:Height} - M# ! Max height

  Hide(?Image1)

  ?Image1{Prop:NoHeight} = 1
  ?Image1{Prop:NoWidth}  = 1

  IF ?Image1{PROP:Width} > L#
    RatioAspect$         = ?Image1{PROP:Height} / ?Image1{PROP:Width}
    ?Image1{PROP:Width}  = L#
    ?Image1{PROP:Height} = L# * RatioAspect$
  END

  IF ?Image1{PROP:Height} > H#
     RatioAspect$         = ?Image1{PROP:Width} / ?Image1{PROP:Height}
     ?Image1{PROP:Height} = H#
     ?Image1{PROP:Width}  = H# * RatioAspect$

  END

  ?Image1{Prop:Xpos} = ( L# + M# - ?Image1{PROP:Width}  ) / 2
  ?Image1{Prop:Ypos} = ( H# + M# - ?Image1{PROP:Height} ) / 2
  UnHide(?Image1)
  Display()

HTH. Eric



Quote:

> >Thanks Richard.

> >I tried it and it works fine.

> >Richard Rogers schreef:


> >> >In a browse window I'd like to display images stored in a blob. While
> >> >browsing, the images need to be refreshed. Can someone help me with
some
> >> >example source?
> >> >(using CW 2.003)

> Hi Adri,

> Good. In response to your other question, look at PROP:Noheight and
> PROP:NoWidth. If you stuff an image with a bitmap and then get the
> height and width, you will get the height and width of the image
> control, not the bitmap. Wacky huh?

> Instead, set PROP:NoHeight to true, PROP:Nowidth to true, and then
> stuff the bitmap in the image. Now if you query the image you will get
> the height and width of the actual bitmap and can calculate the aspect
> ratio. Hide the image before doing all this, and unhide it after in
> order to avoid weird stuff all over your screen.

> Good Luck,

> b. rgds.
> Richard (The Sylkie)
> Oslo

> Calm down folks...it's all just 0's and 1's.



Mon, 10 Mar 2003 03:00:00 GMT  
 Displaying images stored in Blob in a browse window
Hi Richard, Eric,

Your solution works fine in CW5. CW2.003 however doesn't support Prop:NoHeight
and Prop:NoWidth. Any suggestions?

Eric Griset schreef:

Quote:
> Hi adri, to complete, try this code :

>   M# = 10   ! Marging
>   L# = Window{Prop:Width}  - M# ! Max width
>   H# = Window{Prop:Height} - M# ! Max height

>   Hide(?Image1)

>   ?Image1{Prop:NoHeight} = 1
>   ?Image1{Prop:NoWidth}  = 1

>   IF ?Image1{PROP:Width} > L#
>     RatioAspect$         = ?Image1{PROP:Height} / ?Image1{PROP:Width}
>     ?Image1{PROP:Width}  = L#
>     ?Image1{PROP:Height} = L# * RatioAspect$
>   END

>   IF ?Image1{PROP:Height} > H#
>      RatioAspect$         = ?Image1{PROP:Width} / ?Image1{PROP:Height}
>      ?Image1{PROP:Height} = H#
>      ?Image1{PROP:Width}  = H# * RatioAspect$

>   END

>   ?Image1{Prop:Xpos} = ( L# + M# - ?Image1{PROP:Width}  ) / 2
>   ?Image1{Prop:Ypos} = ( H# + M# - ?Image1{PROP:Height} ) / 2
>   UnHide(?Image1)
>   Display()

> HTH. Eric




> > >Thanks Richard.

> > >I tried it and it works fine.

> > >Richard Rogers schreef:


> > >> >In a browse window I'd like to display images stored in a blob. While
> > >> >browsing, the images need to be refreshed. Can someone help me with
> some
> > >> >example source?
> > >> >(using CW 2.003)

> > Hi Adri,

> > Good. In response to your other question, look at PROP:Noheight and
> > PROP:NoWidth. If you stuff an image with a bitmap and then get the
> > height and width, you will get the height and width of the image
> > control, not the bitmap. Wacky huh?

> > Instead, set PROP:NoHeight to true, PROP:Nowidth to true, and then
> > stuff the bitmap in the image. Now if you query the image you will get
> > the height and width of the actual bitmap and can calculate the aspect
> > ratio. Hide the image before doing all this, and unhide it after in
> > order to avoid weird stuff all over your screen.

> > Good Luck,

> > b. rgds.
> > Richard (The Sylkie)
> > Oslo

> > Calm down folks...it's all just 0's and 1's.



Tue, 11 Mar 2003 03:00:00 GMT  
 Displaying images stored in Blob in a browse window
Hi Adri,
YES! destroy your control image then create, then display, then destroy,
then create, then display, then ... Good luck.:)))
Eric



Quote:
> Hi Richard, Eric,

> Your solution works fine in CW5. CW2.003 however doesn't support
Prop:NoHeight
> and Prop:NoWidth. Any suggestions?

> Eric Griset schreef:

> > Hi adri, to complete, try this code :

> >   M# = 10   ! Marging
> >   L# = Window{Prop:Width}  - M# ! Max width
> >   H# = Window{Prop:Height} - M# ! Max height

> >   Hide(?Image1)

> >   ?Image1{Prop:NoHeight} = 1
> >   ?Image1{Prop:NoWidth}  = 1

> >   IF ?Image1{PROP:Width} > L#
> >     RatioAspect$         = ?Image1{PROP:Height} / ?Image1{PROP:Width}
> >     ?Image1{PROP:Width}  = L#
> >     ?Image1{PROP:Height} = L# * RatioAspect$
> >   END

> >   IF ?Image1{PROP:Height} > H#
> >      RatioAspect$         = ?Image1{PROP:Width} / ?Image1{PROP:Height}
> >      ?Image1{PROP:Height} = H#
> >      ?Image1{PROP:Width}  = H# * RatioAspect$

> >   END

> >   ?Image1{Prop:Xpos} = ( L# + M# - ?Image1{PROP:Width}  ) / 2
> >   ?Image1{Prop:Ypos} = ( H# + M# - ?Image1{PROP:Height} ) / 2
> >   UnHide(?Image1)
> >   Display()

> > HTH. Eric




> > > >Thanks Richard.

> > > >I tried it and it works fine.

> > > >Richard Rogers schreef:


> > > >> >In a browse window I'd like to display images stored in a blob.
While
> > > >> >browsing, the images need to be refreshed. Can someone help me
with
> > some
> > > >> >example source?
> > > >> >(using CW 2.003)

> > > Hi Adri,

> > > Good. In response to your other question, look at PROP:Noheight and
> > > PROP:NoWidth. If you stuff an image with a bitmap and then get the
> > > height and width, you will get the height and width of the image
> > > control, not the bitmap. Wacky huh?

> > > Instead, set PROP:NoHeight to true, PROP:Nowidth to true, and then
> > > stuff the bitmap in the image. Now if you query the image you will get
> > > the height and width of the actual bitmap and can calculate the aspect
> > > ratio. Hide the image before doing all this, and unhide it after in
> > > order to avoid weird stuff all over your screen.

> > > Good Luck,

> > > b. rgds.
> > > Richard (The Sylkie)
> > > Oslo

> > > Calm down folks...it's all just 0's and 1's.



Tue, 11 Mar 2003 03:00:00 GMT  
 Displaying images stored in Blob in a browse window
Thanks everyone. I can browse the pictures now.

Adri

Eric Griset schreef:

Quote:
> Hi Adri,
> YES! destroy your control image then create, then display, then destroy,
> then create, then display, then ... Good luck.:)))
> Eric



Tue, 11 Mar 2003 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Storing Native Images in Blobs

2. Store a non-image file in a BLOB

3. Wang OCX and storing images in Blobs

4. Display a browsing image

5. Displaying Thumbnail Images in a browse

6. Displaying Images in a Browse

7. Restore JPEG file from stored BLOB.

8. Question Regarding stored BLOB

9. Storing BLOB within Source Code?!?

10. Storing Documents in BLOB fields

11. The way I decided to store BLOBS..

12. Crystal Reports RPT files stored in a blob?

 

 
Powered by phpBB® Forum Software