October 31, 2025, 02:55:53 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


SETCONTROLTEXT a bitmap not working with image from another computer

Started by JoaoAfonso, July 01, 2008, 05:39:33 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

JoaoAfonso

Good evening.

The following code works if the picture is in my machine (in spite of "\\other_machine", "C:\EB\my_project") , but does not work if is in another machine. Any explanation for this not working, and solution to it?

GETBITMAPSIZE LoadImage("\\other_machine\equipment"+CHR$(92)+d4.return1+".bmp",@IMGBITMAP),w,h
IF (w=150)&(h=150)
foto="\\other_machine\equipment"+CHR$(92)+d4.return1+".bmp"
ELSE
foto="\\other_machine\equipment\foto_default.bmp"
ENDIF
SETCONTROLTEXT d4,35,foto
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Ionic Wind Support Team

Ionic Wind Support Team

JoaoAfonso

JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Ionic Wind Support Team

Wasn't sure what you were attempting with the mixed slashes.  Even in a normal path you need to use the \\ as the \ is an escape character in a string (see the users guide).   So I was assuming you were trying to access a networked computer.

If you are trying to use a relative path based on the location of the executable then the path would be incorrect.

You should put the bitmap in resources and then not have to worry about where it is.

Paul.

Ionic Wind Support Team

JoaoAfonso

I am trying to access a bitmap in a network computer. That bitmap, in this context, is a picture of the equipment.
I open databases and check other .txt files in the network computer using the same path ("\\other_machine\\equipment\\") and it works... can't figure out why accessing other computer it doesn't. Also I scratch my head thinking that this
foto="C:\\EB\\my_project\\equipment\\foto_default.bmp"
works, but this
foto="\\other_machine\\equipment\\foto_default.bmp"
doesn't, so doesn't seems a path's problem.
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

czoran

Hi,

I had similar problem last year. I solved it by "map network drive" in Win Explorer. Maybe that will help you too.
Paul's suggestion to use "\\\\network_computer\\directory\\file" sometimes does not work. Most of the time working fine, but in some networks it doesn't work.

Regards.

aurelCB

I dont know but maby is problem in
you write - IF (w=150)&(h=150)
and where is l,t position?

JoaoAfonso

That line is just to check if the BMP fits in the place I want it to be. But fitting or not, the program or accepts the picture chosen (d4.return1) or uses the default picture (foto_default), so even if that piece of code is wrong, the problem always exist.

Figured out if I get a directory from a txt file, it can be this way and works correctly: 'dir="\\other_machine\directory1\directory2"'. If I want to add to this string got from a txt file another directory, then I must add another slash: 'dir=dir+"\\directory3\\directory4\\foto_default.bmp"'. Anyway, tried everything around it and nothing worked.

What "map network drive" does in order to fix this? Also this program is a client everyone can download and make it run in their own computer, so if "map network drive" works just for my own computer, then that can't be a solution...

A solution it works for sure is if I copy the picture file from the network computer to the client one, like a temporary file, I know I can open that file. It takes more resources, though, and doesn't seem much professional :/ If someone has another ideas, please share. And thanks for all the tips.
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900