Solved

How to store image on datawindow in PB8.

Posted on 2004-08-20
7
937 Views
Last Modified: 2013-12-26
Hi all,

  I would like to know how to store an image (BMP or GIF) into a dataWindow.  I dont want to fix a  path to the image.  What I want is to put the image into the datawindow.  Like what we can do in VB6.  Eventhought we delete that image, our program still can see that image.
When I insertRow() or retrieve(), the logo will display on screen.

  Any idea?  

Regards,
Yong Yih
0
Comment
Question by:yongyih
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 11857782
i don't know your exact requirement but it can be either of the following...

1) permanently store the image in a database table.

for that that column must be of type longbinary or blob according to yr database.

2) Just an icon or picture that u want to display on the screen but not the part of your database.

For that put an picture control in the datawindow and assign bmp or gif file to that picture control. Now your problem is that when u delete that picture file from path it is not showing on that control. So u can solve this problem while u build your executable. create a .pbr file and write down the path name of picture file in that pbr and assign that pbr file to the .pbl when u build your executable. so when u supply exe to your client no need to supply that bmps to the client. It becomes the part of your application. But remember this can not happen in development time. Also when u build executable that time the specified picture file must be there at the location defined in pbr file.

For more about pbr file u can read powerbuilder help. or u can ask here...

what control u r using in vb6 for that same ?

regards,
-Sandeep
0
 
LVL 2

Author Comment

by:yongyih
ID: 11859005
I used Picturebox.  I think as long as we didnt set the path during run time, when we generate exe file, the image will be stored in the exe fil.

1.  Actually our company is using our own framework.  Currently I am using your first method to load image (logo), which stored as BLOB from Oracle database.  But the image only will appear when I issued Retrieve() command. (and it must retrieved at least one record).  And when I print preview the dataWindow (Letter with company logo),  the logo is gone.

  That's why I am looking for another method that can store the logo in the dataWindow itself.

2.  We dont generate exe file for our program.  We only has an exe file to load our application (dataWindow) from server.

  Any idea to solve my problem in item 1.  or other way to load image? ^_^
0
 
LVL 2

Author Comment

by:yongyih
ID: 11925971
If no answer for this question, I would like to delete this question.

Thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:falvaro3
ID: 11931034
Quirky kinda workaround:  
Create a button object with the PictureFile property being the image (load the image in constructor or other event).
Then make sure that the DataWindow.Print.Buttons and DataWindow.Print.Preview.Buttons properties are TRUE in the dw.
0
 
LVL 2

Author Comment

by:yongyih
ID: 11938954
Please tell me what is the command to load image (BLOB data type) from Oracle database (stored in a table), into a button (looks like image, not button) in dataWindow.

If it works, then I know how to do the rest.  

Thanks.
0
 
LVL 4

Accepted Solution

by:
falvaro3 earned 100 total points
ID: 11941886
Use the "SELECTBLOB" SQL statement to get the blob data from the db, then try to see if the SetPicture(blob) method of the button object will work for you.
From the PB help for SELECTBLOB:

Blob  Emp_id_pic
SELECTBLOB Emp_pic
        INTO  :Emp_id_pic
        FROM Employee
        WHERE Employee.Emp_Num = 100
        USING Emp_tran ;

Then, try:
dw_1.object.b_1.SetPicture(Emp_id_pic)

If the setpicture doesn't work, you may have to "offload" the blob data to a temporary image file (ie: C:\Temp\picture.bmp), then set the b_1.filename property at runtime (ie: dw_1.object.b_1.filename="C:\Temp\picture.bmp").
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question