Embed an image to a project (Full Version)

All Forums >> [eMbedded Visual Tools] >> eVB Development



Message


user27 -> Embed an image to a project (4/6/2008 7:34:09 AM)

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?




petevick -> RE: Embed an image to a project (4/7/2008 2:00:05 AM)

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




user27 -> RE: Embed an image to a project (4/7/2008 5:35:14 AM)

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?




petevick -> RE: Embed an image to a project (4/7/2008 7:15:37 AM)

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





user27 -> RE: Embed an image to a project (4/7/2008 7:48:54 AM)

Thenks for the suggestion.

I already try the s309PictureBox with no success.

Probably the only way is the use of API... but how??? [8|][8|][8|]




petevick -> RE: Embed an image to a project (4/7/2008 8:35:27 AM)

Use a proper development language ??
[:D]




user27 -> RE: Embed an image to a project (4/7/2008 3:56:26 PM)

No one freeware unfortunately... so i decide to use eVB (Wrong, wrong, wrong decision)... [:D]

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... 




petevick -> RE: Embed an image to a project (4/8/2008 2:06:44 AM)

All I can suggest is 'hiding' then in the 'Windows' folder and making their attributes read-only

Pete




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

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.




petevick -> RE: Embed an image to a project (4/8/2008 3:38:41 PM)

Just a thought - can you not add them to an image list, and then retrieve them?




user27 -> RE: Embed an image to a project (4/9/2008 3:17:58 PM)

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 [:D]




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5.5 Unicode

0.016