Form
Refresh_pic () the function content is as follows:
The photo control is in DW_1,
Question: how do I read every time is less than photos, read to the local C "\ TEMP. BMP file is always 0 KB, don't know if there is wrong"
CodePudding user response:
Solve the problem of window button pictures show lost://* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the begin * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Step 1. Global variables are defined:
String gs_directory
Step 2. Add the code in the application of open event:
Gs_directory=GetCurrentDirectory ()//saves the current directory
Step 3. In a window with missing images of active event to add code (if inherited window, simply add) to the parent window:
//determine whether the current directory changes
If GetCurrentDirectory () & lt;> Gs_directory then
ChangeDirectory (gs_directory)//if changed will be back in the current directory to
End the if
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//[explain]
//images stored in the application directory,
//control on images with relative path commonly given and point to the application directory.
//programs run started in the current directory is changeless, therefore control according to the relative path to find images;
//after the program is run for some reason the current directory is changed,
//so control according to the changed after the relative path of the current directory to find pictures, so images show lost.
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * end * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CodePudding user response:
That's not what I triedCodePudding user response:
You can't write die c: \ temp. BMP ah, you now is to combine multiple images into temp constant cycle. BMP, say when you save a picture, not necessarily all the BMP format,CodePudding user response:
Add me QQ1919561306 ahCodePudding user response:
See if the field in the database have value, is never kept success, written code also has a problem, should judge sqlcode updateblob behind and not commit after the judgment, if in after a commit, is whether the commit to submit a successIf successfully saved, look at the selectblob whether to value, need to single-step tracking, find the crux of the problem