1. Helge Tjelta
  2. Valentina Database ADK
  3. Пятница, Октябрь 16 2015, 11:50 AM
  4.  Подписаться через email
Hi, how do I get a picture from a db into my web app... ?

In desktop app, i have the VPicture available, but when doing a Webapp, VPicture is gone.... WHY

using V4RB 5.8.5
Комментарий
There are no comments made yet.
Johnny Harris Ответ принят
I grabbed this snippet of code from a web project I have, hopefully it will work for you.


dim mb as MemoryBlock = cur.BlobField("profile_img").ReadData()
dim p as Picture

if mb <> nil then
p = Picture.FromData( mb )
user.Profile.Image = p
end if
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Sergey points that class VPicture itself is marked as NOT console safe.

Helge, meanwhile try to use VCursosr.BlobField() to extract compressed JPG and send it to browser
Комментарий
There are no comments made yet.
Helge Tjelta Ответ принят
Nice, I'm waiting :)
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
I was wrong.

{ (REALproc) Picture_Read, REALnoImplementation, "ReadPicture as Picture", REALconsoleSafe },

{ (REALproc) Picture_WriteAs, REALnoImplementation,
"WritePictureAs( inPict as Picture, inPictType as Integer = 20, inQuality as Integer = 50 )",
REALconsoleSafe },

Methods are console-safe.
Then we need check this from another point of view.

Sergey we have own example with pictures?
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
well, we can check once again this point.
Комментарий
There are no comments made yet.
Helge Tjelta Ответ принят
but we have imagewell as an object for web apps, and use icons and pictures all over the place... I don't get it. ?
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
web application is a console application.

as I remember, for console-safe apps in SDK of Xojo was disabled all picture-related methods.
so we also was need disable them

yes you can try get PNG or JPG using BLOB methods.
Комментарий
There are no comments made yet.
Helge Tjelta Ответ принят
I ment 5.8.8, also checked the new 6.0.10. Still no VPicture

Do I have to go BLOB ?
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories