use of IPicture

could someone please enlighten me on how to use the IPicture to display 
an image when I already have a HBITMAP to the picture to display? I have 
seen the code on CodeProject on how to display picture loading from 
file, but I need to use in memory HBITMAP and I don't know what OLE 
function to call to enable that. could someone please help?
0
6/30/2005 4:22:26 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
871 Views

Similar Articles

[PageSpeed] 57

Hello Lonewolf,

> could someone please enlighten me on how to use the IPicture to
> display an image when I already have a HBITMAP to the picture to
> display? I have seen the code on CodeProject on how to display picture
> loading from file, but I need to use in memory HBITMAP and I don't
> know what OLE function to call to enable that. could someone please
> help?

I dont think you need any OLE method to do this. If you already have a valid 
HBITMAP, you could use CStatic::SetBitmap() to display it. You will need 
to create a CStatic first(dynamically or in designer).

-- 
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.co


0
ajaykalra (6842)
6/30/2005 4:29:48 AM
"Lonewolf" <anonymous@mozilla.org> wrote in message
news:e29tRtSfFHA.2152@TK2MSFTNGP14.phx.gbl...
> could someone please enlighten me on how to use the IPicture to display
> an image when I already have a HBITMAP to the picture to display? I have
> seen the code on CodeProject on how to display picture loading from
> file, but I need to use in memory HBITMAP and I don't know what OLE
> function to call to enable that. could someone please help?

OleCreatePictureIndirect, maybe.
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
6/30/2005 6:08:02 AM
My Question:- Where you want to display your picture !.


--
cheers,
Alok Gupta
Blogs: http://wdevs.com/thatsalok
"Lonewolf" <anonymous@mozilla.org> wrote in message
news:e29tRtSfFHA.2152@TK2MSFTNGP14.phx.gbl...
> could someone please enlighten me on how to use the IPicture to display
> an image when I already have a HBITMAP to the picture to display? I have
> seen the code on CodeProject on how to display picture loading from
> file, but I need to use in memory HBITMAP and I don't know what OLE
> function to call to enable that. could someone please help?


0
thatsalok1 (226)
6/30/2005 6:51:51 AM
Ajay Kalra wrote:
> Hello Lonewolf,
> 
>> could someone please enlighten me on how to use the IPicture to
>> display an image when I already have a HBITMAP to the picture to
>> display? I have seen the code on CodeProject on how to display picture
>> loading from file, but I need to use in memory HBITMAP and I don't
>> know what OLE function to call to enable that. could someone please
>> help?
> 
> 
> I dont think you need any OLE method to do this. If you already have a 
> valid HBITMAP, you could use CStatic::SetBitmap() to display it. You 
> will need to create a CStatic first(dynamically or in designer).
> 

Well, actually the reason for using IPicture is because there is this 
code from the net, CodeProject actually which used IPicture to generate 
thumbnail of the image. It looks very nice and I believe will be faster 
than using GDI+, thus I want to use it. But the example generates the 
thumbnail based on path to the original file, whereas my HBITMAP is 
actually grabbed from a video file. Basically I am trying to generate a 
preview image of the video file, adn I have used IMediaDet and GDI+ to 
accomlpish it. I just want to use another way of generating the 
thumbnail that's all. But obviously IPicrure is not some COM interface I 
can generate using CoCreateinstance, instead it is obtained by some OLE 
function. I don't know what function to call to pass in a HBITMAP and 
instantiate a IPicture object. could you enlighten me on this?
0
6/30/2005 8:53:56 AM
thatsalok wrote:
> My Question:- Where you want to display your picture !.
> 
> 
> --
> cheers,
> Alok Gupta
> Blogs: http://wdevs.com/thatsalok
> "Lonewolf" <anonymous@mozilla.org> wrote in message
> news:e29tRtSfFHA.2152@TK2MSFTNGP14.phx.gbl...
> 
>>could someone please enlighten me on how to use the IPicture to display
>>an image when I already have a HBITMAP to the picture to display? I have
>>seen the code on CodeProject on how to display picture loading from
>>file, but I need to use in memory HBITMAP and I don't know what OLE
>>function to call to enable that. could someone please help?
> 
> 
> 

in a CStatic control set to bitmap.. for now. as long as I can get back 
a HBITMAP of a thumbnail, I can put it in a CListCtrl if i want. But 
thing is, how do I use IPicture with a HBITMAP? The OLE function i saw 
from the example use load from file. I don't know how to load from memory.
0
6/30/2005 8:56:52 AM
Reply:

Similar Artilces:

OX80042109 Message when Unable to Send Email in 2003 Outlook using verizon DSL
I was unable to send email in my outbox today using a new (2 week old) Dell GX520, microsoft small business edition (OUTLOOK 2003) and Verizon DSL. Kept getting unable to connect to the outgoing server and this 0X80042109 message. Also the incoming pop connection couldn't be made, although I still go my incoming email. Only outgoing was stuck in the outgoing box. Verizon said the OX is a microsoft error. He took out all my settings for verizon and put them back in and then it worked. But what does this OX signify? He thought there might be a corruption in a DLL file. This is my 3rd ...

using validation to autofill cell
hi.. i have an excel sheet that i use validation to choose what i want to fill cell with. what i'd like to do is to autofill another cell based on what i pick from the validation drop down list. i have 2 lists e.g. list1 list2 x 1 y 2 z 3 if from my drop down box i pick x i'd like cell B5 (for example) to show 1 and so on. thanks in advance for any help You can use a VLookup formula to return the matching value when an item is selected. There's information in Excel's Help, and here: http://www.con...

How can I use Using Smart Pointer Classes in msxml api and also Include Headers and Libraries Manually.
How can I use Using Smart Pointer Classes in msxml api and also Include Headers and Libraries Manually H I have some problem to using smart pointer in msxml , I can include Headers and Libraries Manually by doing 1. put #include <msxml2.h> in my header files 2. Link msxml2.lib to my project But I am not be able to using smart pointer which is very nice I only can using smart point by putting #import <msxml4.dll using namespace MSXML2 in my header file. But this is requires msxml4.dll in my system path otherwise the project will not compile. Our project is big so that all the runtime...

Search using exact criteria for customers
In Point of Sale there should be an option for an 'exact search', so that results that do not match any existing records do not return a result that is similar to what was searched on. Currently users will enter an incorrect or non-existent customer number and will accidentally select the wrong customer instead of receiving an "Invalid number" message. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do n...

Using Checkboxes to add data to a table.
I have been having trouble developing this form for a couple of days. It seems the solution should be simple but so am I. I have an input form with four text boxes. I need to use the same data and create a new line in the table for up to but not always 9 different company positions. I was given a possible way of keeping the info on the form for the next position using the AfterUpdate event and setting the default back to the same box. But in using his suggestion I get #NAME? for the boxes with text when I select the next new record. The boxes with numbers come back the way he said it wo...

Using Active Directory Users and Computers to administer Exchange
We have a 50+ Exchanger Server setup, 10 5.5 servers and over 40 2003 servers. I have Windows 2000 Professional on my workstation. When I go to a group in ADUC and try to add a user to the message restrictions part, I get an error. It is: Access Denied Facility: LDAP Provider ID no: 8007005 Microsoft Active Directory - Exchange Extensions. If I use 5.5 Admin, I can edit the message restrictions. Any ideas? do you have exchange system manager on your 2000 pro workstation? if not, you won't be able to use exchange extensions from there just be cautious if you install it with outlook;...

How use .bak restore email
i make a mistake that delete all the mail in outlook express 6. and now i just have a .bak file,other files are missing(include .pst). i try to change name .bak to .pst ,but use scanpst.exe and outlook input fail. so can i restore my email through a .bak file? or i will lose my email? thanks Outlook express 6 doesn't use a pst. If it really is OE, see if http://www.insideoe.com has the information you need. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.sl...

Excel VBA
I have written an App which runs fine on a Windows PC (Win98 or XP) with 128 Mb or RAM It immediately runs out of memory when run on a Mac of similar spec with OS9. I have fiddled with the settings on the Mac, and maybe I can solve it if I give Excel enough memory, but I am not very knowledgeable about memory use on the programming side. Is there anything I should be looking for in my code which could be gobbling up memory? Many thanks in advance, Andy Keen Unlike Mac OSX, Mac OS 9 doesn't automatically allocate more memory. Instead, the amount of memory allocated to the app is s...

Using Lotus 123 command in excel 2003
I m using Office 2003. But problem is that there i could not able to use lotus 123 command. Why so? Please help me Rao Ratan Singh Why would you? I believe it allows for some things to be done and you can go to tools>options>transition to change a few things -- Regards, Peo Sjoblom (No private emails please) "Rao Ratan Singh" <RaoRatanSingh@discussions.microsoft.com> wrote in message news:0267594A-0E71-4A73-89B1-C78B788545C7@microsoft.com... >I m using Office 2003. But problem is that there i could not able to use > lotus 123 command. > > Why so? ...

SMTP still uses smarthost setting after deleting it
Environment: --Exchange 2003 on SBS 2003 --SonicWALL TZ170 --SWBELL DSL After ISP change, I removed the smarthost I had configured on the default virtual smtp server configuration. All messages queue stating "The remote server did not respond to a connection attempt". After turning on debug logging, I found that all connection attempts were still being made to the original smarthost which was now gone. After first restarting the smtp service with no change, I rebooted the server. However, the messages are still in the queue and the same message gets logged. I've als...

login to crm without using the :5555 extension, how?
Hi all, I have 2 questions: 1. I am trying to change the logon adress of MSCRM to crm.businessname.com instead of using the crm.businessname.com:5555 can someone help me to get it to work? 2. I created a header in IIS, and created a pointer in DNS. i can logon to CRM, but i get an error on the chapters: activity, agenta, accounts and contact The error is: The underlying connection was closed: Unable to connect to the remote server. Description: An unhandled exception occurred during the execution of the current web request. Pleas...

Drop-down list on simple excel 2003 form using "form" from data me
I have 2 sheets, one with a list of company names for a drop down list The second sheet has several columns, the first of which is the company name In the fields under the company name column, I set up data validation and set it to look up from the first sheet (I named the list first) "CompanyList" The drop down list works fine if entering from the worksheet itself. But if I choose "form" from the "Data" menu, the basic form comes up with all the fields, but there is no drop down for the company field I don't want to create a combo box or use VB...

when to use case instead of nested iifs
ok, I am attempting to do this without a massive amount of queries each doing a part of it which would be really easy but not "right" and would result in poor performance I'm sure do to the loading time on each query etc. What I am trying to do is filter down the results by 2 groups of criteria where they produce a numeric value for each of the conditions and display the data where the two conditions match... Sounds more complex than it is really I'll post the sql to give you a better idea, but my questions are 1. should I be trying to do this in a query or should I use a fun...

What tables and fields should I use?
I am looking for database design help with my tables and fields. I have 75 questions, but I will continue to add more. I plan on giving at least 100 answers to each question. As a result I want to be able to keep a record of all the answers I give for a particular question. How many tables would you recommend I use? and what fields should be in each table? Teddy, Have a look at... http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=3 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.r...

Second serie doesn't use X-as values
I created a chart on a worksheet and defined the X-ax (Category Xax label =Position!$G$4:$G$42) and the first serie (Values =Position!$O$4:$O$42). Everything looks OK. Now I add another serie (Values =Position!$P$4:$P$42) and although this line should be straight it doesn't. If I select the first serie in the chart both the ranges for the X-ax (G) and the values (O) are marked on the worksheet. If I select the second serie in the chart ONLY the range for the values (P) has been marked. Also , if I delete the first serie from the chart after selection it, the values displayed for the ...

Tim, Neil, Zach.. besides using FFDSHOW for mpg's which codec do you like for playing DVD'S?
Hello again, I made the successful jump to WMP 11 everything is fine! I have yet to install FFDSHOW for the mpg playback but which one do you like to use for playing DVD'S in WMP 11? I will not be upgrading beyond WMP 11 so the buck stops here. Thanks for all your help and consideration, Regards, J Tinsby On Wed, 20 Jan 2010 15:17:24 -0500, J Tinsby <none@present.com> wrote: >I made the successful jump to WMP 11 everything is fine! I have yet to >install FFDSHOW for the mpg playback but which one do you like to use >for playing DVD'S in WMP 11? ...

why is the feature "share workbook" unavailable to use
I am trying to share a work book but the feature is grayed out, not sure why - pls explain ...

Create Report using fields from Form's datasheet
I have a form in datasheet view and I have a control that allows me to view and hide various fields. I would like to be able to click a button to create a report for printing using the fields that are visible on the datasheet. I don't need to be able to save the report for later use. I'd like it to open the report in layout view so I can edit field sizes and what not to ensure the report fits on one page (usually). Thanks again! I would just push the data to Excel. -- Duane Hookom MS Access MVP "Gntlhnds" <Gntlhnds@discussions.microsoft.com>...

Programming PowerPoint using VBA
I have been working on a project where I need to add some shapes to a presentation using VBA. Of course I run the code as I test many times and each time I do notice the shapes just keeping getting added to the slides. What I don't understand is why the objects I am adding persist after the slide show is no longer executing. They even remain part of the presentation when I close and reopen it. Why is that? I haven't even saved the presentation. I know I am missing something fundamental here, but it has been difficult to find a resource on the Net to explain away my co...

Use Value In An Adjacent Cell
I would like to find the maximum number in a column of numbers and then use the value in the cell one cell above and one cell to the right of the maximum number. Can someone assist me with the formula? The Data: B C D 10/25/2004 57,636 19.039 11/03/2004 58,015 19.627 11/12/2004 58,431 17.774 This formula will return 58,431 (the maximum number in the range) =MAX($C$6:$C$55) Once I find that number I need the value one cell above and one cell to the right (19.627 in this case). ...

Generate number NOT using a form
Hi, I've searched hi an low on this site and others, and the nearest match was a question from Galaxykid in November. I'm running Office 2000 and have used the Template Wizaed to create a template that is used as a form to input data into another spreadsheet. I would like one field on the template (which appears as a spreadsheet NOT an Excel Form) to generate sequential numbers for each new record that is entered and saved using my template. I know it can't be that hard but I've been trying to figure this out for two days! Help!!!!! Thanks in advance. Davis Try loo...

Import Data using Forms
Hi, Can anyone tell me how I can set up a form to import an excel sheet into an exisiting table in access? Thank you!! You can use the TransferSpreadsheet Method to import a spreadsheet. The click event of the button would run the code you write for the import. "carolini" <carolini@discussions.microsoft.com> wrote in message news:A30B2F52-96CD-421B-A940-A200A0D129CF@microsoft.com... > Hi, > > Can anyone tell me how I can set up a form to import an excel sheet into > an > exisiting table in access? > > Thank you!! > On Mon, 23 Apr 2007 12:24...

Using IF and MAX (and IF and MIN) together
I am a newbie to Excel. I have a spreadsheet for a class in which I am required to find the most sales by using IF and MAX. Also, I must find the least sales using IF and MIN. Can anyone help me put a formula together? Becky Wrote: > I am a newbie to Excel. I have a spreadsheet for a class in which I am > required to find the most sales by using IF and MAX. Also, I must find > the > least sales using IF and MIN. Can anyone help me put a formula > together? Assuming your sales figures are in A1:A100, use *=max(A1:A100) * to determine the maximum number in the range a...

Is it possible to use USB ports in Visual C++ 6.0 (MFC)?
Best regards bayX wrote: > Best regards It depends on what you mean by "use." -n "Nikolaos D. Bougalis" <nikb@webmaster.com> wrote: >bayX wrote: > >> Best regards > > It depends on what you mean by "use." > > -n Now that is really helpful, how about "communicate with USB device" ? In my case I have a GUID and driver supplied by the device manufacturer, but cannot see how to use them. Colin I have a gsm phone. I want to write a program that will send SMS. My gsm phone can be connected to my computer from USB . S...

Change xlstart path
Is there a way to change the path of the xlstart folder , so that it points to a network path. I know there is an alternate startup path but that is for XL templates. I need to point to a macro , so that the macro starts up when opening excel. Hope this makes sense. I wouldn't change this setting (even if I knew how). And I wouldn't want you to change it for me, either. Have you thought of just telling people to install an addin: tools|addins and point to that network workbook Craig wrote: > > Is there a way to change the path of the xlstart folder , so that it points ...