Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

> Save Picture In VB6, can't really figure it out

views
     
TSatria83
post Feb 20 2006, 10:39 PM, updated 14y ago

Getting Started
**
Junior Member
238 posts

Joined: Jan 2005


This is partial of my program so far...try to save image generated into the database...somehow...the path of picture can be easily stored..but the problem...is at the picture...it won't save....

'FileSave Picture1

picName = tbProdID.Text

file_name = App.Path & "\img\"

If Right$(file_name, 1) <> "\" Then file_name = _
file_name & "\"

'save picture problem could not be settle

' | <--- used this command..but came out error...
' V
SavePicture Picture1.Picture, file_name & picName & ".bmp"

rs("barcode") = App.Path & "\img\" & picName & ".bmp"

so...anyone had any ideas on how to do this..??please...been stuck for sometimes...
AaronZe
post Feb 20 2006, 10:51 PM

Getting Started
**
Junior Member
135 posts

Joined: Aug 2005


I suggest that u stored the path of the picture and load it into your program during runtime.....and the pictures would be stored in a folder.....not sure whether can store picture in database....tried b4 but finally resort to the method i stated above.....i think there should be a way, but i dont know....hehe...... smile.gif
TSatria83
post Feb 21 2006, 12:48 AM

Getting Started
**
Junior Member
238 posts

Joined: Jan 2005


the picture going to be saved on diff folder...only the path be saved into the database....problems is...can't really figure out about the function SavePicture...
nxfx
post Feb 21 2006, 08:34 AM

Enthusiast
*****
Senior Member
938 posts

Joined: Jan 2003


Make sure the path exist and correct. Whats the error btw?
TSatria83
post Feb 21 2006, 06:22 PM

Getting Started
**
Junior Member
238 posts

Joined: Jan 2005


hmm..the path got no problem....somehow..the picture generated in VB cannot be save...been searching that i need to used the SavePicture function..but it still won't work...so any idea...??
AaronZe
post Feb 21 2006, 06:30 PM

Getting Started
**
Junior Member
135 posts

Joined: Aug 2005


I am not sure whether this works >>> Click here
SincerePrayer
post Feb 21 2006, 08:04 PM

love to pray
Group Icon
Elite
1,120 posts

Joined: Jun 2005
atria83,


What is the actual error message you are getting?
Perhaps you might want refer the sample code here


Happy Coding smile.gif
ashow
post Feb 22 2006, 08:39 PM

New Member
*
Junior Member
36 posts

Joined: Apr 2005
1 of the solution is convert the pic to binary code/string then store the it at database.

i can give u the sample code if u need it
TSatria83
post Feb 22 2006, 09:52 PM

Getting Started
**
Junior Member
238 posts

Joined: Jan 2005


thanks to all respons...really appriciate it..but my idea is like this...the picture are going to be saved into one folder...while the image path are store into the database...so when ever i try to recall back the image..i just query the image path...and VB diplay back the image base on path that are stored in my database...

somehow..the problem is...when ever the barcode image are generated(it's not save yet)..without using the SavePicture command..i can save the path of picture into the database...but there is no picture save into the folder that i assign to save generated barcode..

user posted image


nxfx
post Feb 23 2006, 08:35 AM

Enthusiast
*****
Senior Member
938 posts

Joined: Jan 2003


Have you set the autoRedraw to True and try using Picture1.image.
TSatria83
post Feb 23 2006, 02:18 PM

Getting Started
**
Junior Member
238 posts

Joined: Jan 2005


hmm..i'm gonna try it...anything i will post back....thanks nxfx

 

Switch to:
| Lo-Fi Version
0.0322sec    1.22    5 queries    GZIP Disabled
Time is now: 19th November 2019 - 05:22 AM