Skip to main content

Embed an image to a project

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [eMbedded Visual Tools] >> eVB Development >> Embed an image to a project Page: [1]
Login
Message << Older Topic   Newer Topic >>
Embed an image to a project - 4/6/2008 7:34:09 AM   
user27

 

Posts: 6
Joined: 4/6/2008
Status: offline
Hi there
I am trying to embed an image on my project and then to load in an imagebox or picturebox. I try loadimage and loadbitmap functions with no luck. Always the same message. "File Not Found". Do i declere the functions wrong. Do i call them wrong. My code is:

'Declarations
Declare Function LoadImage Lib "coredll" Alias "LoadImageW" (ByVal hInst As Long, ByVal lpsz As Long, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long

Declare Function LoadBitmap Lib "coredll" Alias "LoadBitmapW" (ByVal HISTANCE As Long, ByVal LPCTSTR As Long) As Long

'Calling the functions

ImageCtl1.Picture = LoadBitmap(App.hInstance, 1)

ImageCtl1.Picture = LoadImage(App.hInstance, 1, IMAGE_BITMAP, 0, 0, 0)

Please help. What i am doing wrong?
Post #: 1
RE: Embed an image to a project - 4/7/2008 2:00:05 AM   
petevick


Posts: 3320
Joined: 4/26/2002
From: Bolton - UK
Status: offline
If I remember correctly, in eVB only picture with 256 cololours are supported???

I also think you don't need the API - I think you can say imageCTL1.picture = "\My Documents\mypic.bmp"

BUT, it is years since I used eVB

_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to user27)
Post #: 2
RE: Embed an image to a project - 4/7/2008 5:35:14 AM   
user27

 

Posts: 6
Joined: 4/6/2008
Status: offline
Thank you for the reply petevick

It is true that only image with 256 colours is suported. ImageCTL1.picture = "\My Documents\mypic.bmp" works but i dont want the image to be an external file. I dont want to give the ability to the user to delete or alter the image. So i decide to use API. Is there any other methode to include the image in the .vb project?

(in reply to petevick)
Post #: 3
RE: Embed an image to a project - 4/7/2008 7:15:37 AM   
petevick


Posts: 3320
Joined: 4/26/2002
From: Bolton - UK
Status: offline
Take a look at s309picturebox - see if that allows you to do that.
You can set the picture property at design time, but I can't remember if that embeds the image or not.

Remember, the world has come a long way since eVB was last supported



_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to user27)
Post #: 4
RE: Embed an image to a project - 4/7/2008 7:48:54 AM   
user27

 

Posts: 6
Joined: 4/6/2008
Status: offline
Thenks for the suggestion.

I already try the s309PictureBox with no success.

Probably the only way is the use of API... but how??? 

(in reply to petevick)
Post #: 5
RE: Embed an image to a project - 4/7/2008 8:35:27 AM   
petevick


Posts: 3320
Joined: 4/26/2002
From: Bolton - UK
Status: offline
Use a proper development language ??


_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to user27)
Post #: 6
RE: Embed an image to a project - 4/7/2008 3:56:26 PM   
user27

 

Posts: 6
Joined: 4/6/2008
Status: offline
No one freeware unfortunately... so i decide to use eVB (Wrong, wrong, wrong decision)...

But i managed to develop what i want, few months later, after a handreds of limitations, obstacles and bugs of eVB.

It is pity to give up now. My app is almost ready. I only want to add some small images to look better... 

(in reply to petevick)
Post #: 7
RE: Embed an image to a project - 4/8/2008 2:06:44 AM   
petevick


Posts: 3320
Joined: 4/26/2002
From: Bolton - UK
Status: offline
All I can suggest is 'hiding' then in the 'Windows' folder and making their attributes read-only

Pete

_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to user27)
Post #: 8
RE: Embed an image to a project - 4/8/2008 9:34:53 AM   
user27

 

Posts: 6
Joined: 4/6/2008
Status: offline
This is not a satisfactory solution to me. I prefer not to include any image if i dont manage to embed it.

Thanks anyway petevick. I realy appreiciate your friendliness.

(in reply to petevick)
Post #: 9
RE: Embed an image to a project - 4/8/2008 3:38:41 PM   
petevick


Posts: 3320
Joined: 4/26/2002
From: Bolton - UK
Status: offline
Just a thought - can you not add them to an image list, and then retrieve them?


_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to user27)
Post #: 10
RE: Embed an image to a project - 4/9/2008 3:17:58 PM   
user27

 

Posts: 6
Joined: 4/6/2008
Status: offline
Is that posible ??? I will try it. Thanks

You know... i discovered why loadimage and loadbitmap doesn't work. The syntax logicaly is OK but... these functions returns pointers and eVB doesn't support pointers nor structures either. Big disapointment. I also wanted to retrieve the sound volume of the device with waveoutgetvolume function and guess what... the function return pointer too and no value. The current volume of the device is essential for my app. Now i am realy stuck.
I found a library named vbpointer.dll to overcome those problems. Too promising but the library doesn't seem to work with wm5.

Now i am thinking to develop my own dll using eVC++ wich internaly will use the waveoutgetvolume and return the value to eVB. Is than possible? I never developed an dll.

What an adventure

(in reply to petevick)
Post #: 11
Page:   [1]
All Forums >> [eMbedded Visual Tools] >> eVB Development >> Embed an image to a project Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.5.5 Unicode

0.016