msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to extract a jpg from a resource and load into image con

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
AppleBag



Joined: 04 Oct 2007
Posts: 24

PostPosted: Thu Sep 07, 2006 6:13 am    Post subject: How to extract a jpg from a resource and load into image con Reply with quote

Hello all

As the topic mentions, I have a jpg in the "Custom" area of my VB6 .res
file. I realize I could just convert the jpg into a bmp and use
LoadResPicture, but I like the smaller size of the jpg.

I would however like to accomplish teh same objective. I have an image
control, that I want to place for the image, the jpg from my resource
file. Using Set Picture1.Picture = LoadResPicture(104, vbResBitmap)
gives me a "picture not found" type error, while LoadResData(104,
"CUSTOM") gives me a "objectr required" type error.

VB won't simply let me save a jpg in the BMP slot of the resource file,
so the only way I can see is to place it in the custom area.

Another thing I should mention, is that I do not want to first extract
the jpg file to the hard drive and then tell the image control to use
it, I want it all done in memory.

Does anyone know how I can do this?

TIA

Archived from group: microsoft>public>vb>enterprise
Back to top
View user's profile Send private message
AppleBag



Joined: 04 Oct 2007
Posts: 24

PostPosted: Thu Sep 07, 2006 11:43 pm    Post subject: Re: How to extract a jpg from a resource and load into image Reply with quote

Anyone?

AppleBag wrote:
> Hello all
>
> As the topic mentions, I have a jpg in the "Custom" area of my VB6 .res
> file. I realize I could just convert the jpg into a bmp and use
> LoadResPicture, but I like the smaller size of the jpg.
>
> I would however like to accomplish teh same objective. I have an image
> control, that I want to place for the image, the jpg from my resource
> file. Using Set Picture1.Picture = LoadResPicture(104, vbResBitmap)
> gives me a "picture not found" type error, while LoadResData(104,
> "CUSTOM") gives me a "objectr required" type error.
>
> VB won't simply let me save a jpg in the BMP slot of the resource file,
> so the only way I can see is to place it in the custom area.
>
> Another thing I should mention, is that I do not want to first extract
> the jpg file to the hard drive and then tell the image control to use
> it, I want it all done in memory.
>
> Does anyone know how I can do this?
>
> TIA
Back to top
View user's profile Send private message
AppleBag



Joined: 04 Oct 2007
Posts: 24

PostPosted: Mon Sep 18, 2006 12:33 pm    Post subject: Re: How to extract a jpg from a resource and load into image Reply with quote

Not possible?

AppleBag wrote:
> Anyone?
>
> AppleBag wrote:
> > Hello all
> >
> > As the topic mentions, I have a jpg in the "Custom" area of my VB6 .res
> > file. I realize I could just convert the jpg into a bmp and use
> > LoadResPicture, but I like the smaller size of the jpg.
> >
> > I would however like to accomplish teh same objective. I have an image
> > control, that I want to place for the image, the jpg from my resource
> > file. Using Set Picture1.Picture = LoadResPicture(104, vbResBitmap)
> > gives me a "picture not found" type error, while LoadResData(104,
> > "CUSTOM") gives me a "objectr required" type error.
> >
> > VB won't simply let me save a jpg in the BMP slot of the resource file,
> > so the only way I can see is to place it in the custom area.
> >
> > Another thing I should mention, is that I do not want to first extract
> > the jpg file to the hard drive and then tell the image control to use
> > it, I want it all done in memory.
> >
> > Does anyone know how I can do this?
> >
> > TIA
Back to top
View user's profile Send private message
Sinna



Joined: 04 Oct 2007
Posts: 191

PostPosted: Tue Sep 19, 2006 12:13 pm    Post subject: Re: How to extract a jpg from a resource and load into image Reply with quote

AppleBag wrote:
> Not possible?
>
> AppleBag wrote:
>> Anyone?
>>
>> AppleBag wrote:
>>> Hello all
>>>
>>> As the topic mentions, I have a jpg in the "Custom" area of my VB6 .res
>>> file. I realize I could just convert the jpg into a bmp and use
>>> LoadResPicture, but I like the smaller size of the jpg.
>>>
>>> I would however like to accomplish teh same objective. I have an image
>>> control, that I want to place for the image, the jpg from my resource
>>> file. Using Set Picture1.Picture = LoadResPicture(104, vbResBitmap)
>>> gives me a "picture not found" type error, while LoadResData(104,
>>> "CUSTOM") gives me a "objectr required" type error.
>>>
>>> VB won't simply let me save a jpg in the BMP slot of the resource file,
>>> so the only way I can see is to place it in the custom area.
>>>
>>> Another thing I should mention, is that I do not want to first extract
>>> the jpg file to the hard drive and then tell the image control to use
>>> it, I want it all done in memory.
>>>
>>> Does anyone know how I can do this?
>>>
>>> TIA
>

Yes, it *is* possible but not that easy to do in VB6. Have a look at
GDI+. Perhaps you can start your search on www.codehound.com/vb.


Sinna

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Resource Kit for VB6 Folks: I am a newbie to VB6 which is installed on my Windows XP Home Edition. I know that there is a product called Resource Kit for VB .Net. * Where can I find Resource Kit for regular VB6; assuming this product exists ? * Would it be advisable to in

Resource Editor How do I get the resource editor to show up in my "Add ins" menu????? Where is the resource editor -Lou

Resource editor HELP Hello friends I re-installed VB6 Enterprise on Windows XP and i can't find te resource editor anymore in the add-ins ! On a second harddisk with Win98 and also VB6 (since years) The resource editor is available and works correct. Any idea on how to make t

Retrieve data from resource file in VB Hi there, In my project, there is a requirement to show a bitmap image in the pull down menu items. This bmp is already there at the harddisk. I now need to store it in resource file.....so that it is not dependent on the machine's harddisk. I want this f

Visual Basic 6.0 Resource Center Just got an MSDN Flash with the following information: > Hey, VB6 diehards. We heard ya > > Really let us know what you think about this site. I haven't checked it out, but they have it divided into three section
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group