Click here to Skip to main content
16,005,389 members
Home / Discussions / C#
   

C#

 
GeneralRe: Combo box bind to object ... need help Pin
kakarato13-Jul-05 22:14
kakarato13-Jul-05 22:14 
Questionhow can I access, windows forms properites by other thread than the form Pin
machocr13-Jul-05 11:18
machocr13-Jul-05 11:18 
AnswerRe: how can I access, windows forms properites by other thread than the form Pin
Sau Fan Lee13-Jul-05 13:13
Sau Fan Lee13-Jul-05 13:13 
GeneralRe: how can I access, windows forms properites by other thread than the form Pin
machocr14-Jul-05 4:25
machocr14-Jul-05 4:25 
GeneralMemory problem Pin
AnonymousTwo13-Jul-05 9:21
AnonymousTwo13-Jul-05 9:21 
GeneralRe: Memory problem Pin
Dave Kreskowiak13-Jul-05 9:42
mveDave Kreskowiak13-Jul-05 9:42 
GeneralGET Image Constructor Pin
Expert Coming13-Jul-05 9:12
Expert Coming13-Jul-05 9:12 
GeneralRe: GET Image Constructor Pin
Judah Gabriel Himango13-Jul-05 9:18
sponsorJudah Gabriel Himango13-Jul-05 9:18 
As far as I know, the Image and Bitmap objects do not store the file name.

What you can do, however, is set the tag of the Bitmap to the file name, then retrieve that tag at a later date:

// Load some bitmap...
string fileName = "hello.jpg";
Bitmap myBitmap = new Bitmap(fileName);
myBitmap.Tag = fileName;
pbPicture.Image = myBitmap;

// At some later point in code...
Bitmap imageInPictureBox = (Bitmap)pbPicture.Image;
string theFileName = (string)myBitmap.Tag;


Further, you could put the file name and image in some dictionary/hashtable for easy use...but the above code should work fine for you with little overhead.

Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango


GeneralRe: GET Image Constructor Pin
Expert Coming13-Jul-05 18:25
Expert Coming13-Jul-05 18:25 
GeneralRe: GET Image Constructor Pin
Judah Gabriel Himango14-Jul-05 5:03
sponsorJudah Gabriel Himango14-Jul-05 5:03 
GeneralText can't be fully displayed on a button Pin
sparks_lu13-Jul-05 8:52
sparks_lu13-Jul-05 8:52 
GeneralCOM+ & .NEt parameters by reference Pin
raforaez13-Jul-05 8:06
raforaez13-Jul-05 8:06 
GeneralRe: COM+ & .NEt parameters by reference Pin
Judah Gabriel Himango13-Jul-05 9:11
sponsorJudah Gabriel Himango13-Jul-05 9:11 
GeneralRe: COM+ & .NEt parameters by reference Pin
raforaez13-Jul-05 9:28
raforaez13-Jul-05 9:28 
GeneralDataGrid: lock row height, paint icons in BoolColumn Pin
SebbaP13-Jul-05 7:30
SebbaP13-Jul-05 7:30 
GeneralScroll panel from caret Pin
mr_seus13-Jul-05 6:31
mr_seus13-Jul-05 6:31 
GeneralRe: Scroll panel from caret Pin
Judah Gabriel Himango13-Jul-05 9:14
sponsorJudah Gabriel Himango13-Jul-05 9:14 
GeneralRe: Scroll panel from caret Pin
mr_seus13-Jul-05 13:40
mr_seus13-Jul-05 13:40 
QuestionHow to create a shortcut Pin
kevin_smoke13-Jul-05 5:43
kevin_smoke13-Jul-05 5:43 
AnswerRe: How to create a shortcut Pin
Judah Gabriel Himango13-Jul-05 7:46
sponsorJudah Gabriel Himango13-Jul-05 7:46 
GeneralLoggin in C# Pin
rnvrnv13-Jul-05 5:31
rnvrnv13-Jul-05 5:31 
GeneralRe: Loggin in C# Pin
S. Senthil Kumar13-Jul-05 6:31
S. Senthil Kumar13-Jul-05 6:31 
GeneralRe: Loggin in C# Pin
eggie513-Jul-05 6:55
eggie513-Jul-05 6:55 
GeneralRe: Loggin in C# Pin
Steve Maier13-Jul-05 7:18
professionalSteve Maier13-Jul-05 7:18 
GeneralHuge problem with controls Pin
zaboboa13-Jul-05 5:17
zaboboa13-Jul-05 5:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.