How to put a image pixel array to a CImageList?

I have a image pixel array like DWORD ImageBits[16][16]={0xff00ff,...}.

My code just gives me a black image on the toolbar button.

CImageList imgList;
CBitmap bmImages;
VERIFY(bmImages.CreateBitmap(16, 16, 1, sizeof(RGBQUAD) * 8, &ImageBits));
HIMAGELIST hImages;
hImages = ImageList_Create(16, 16, ILC_COLOR16 | ILC_MASK, 1, 0);
imgList.Attach(hImages);
imgList.Add(&bmImages, RGB(255, 0, 255));
GetToolBarCtrl().SetImageList(&imgList);
imgList.Detach();

Thank you.


0
Su
4/22/2005 8:28:05 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
380 Views

Similar Articles

[PageSpeed] 49

Reply:

Similar Artilces:

Sum(if array isn't working..
=SUM((ISNUMBER(B3:B416))*(DATE(RIGHT((date!B3:B416),4),MID((date!B3:B416),4,2),LEFT((date!B3:B416),2))=(TODAY()-1))*(B3:B416)) Hello, the above formula is my latest try to sum a certain rang (b3:b416) which has to be a number, while the corresponding cell i sheet date! has to have a date equalling yesterday. Unfortunately th date! sheet does not have the date in the right format.... and i don' want to add another sheet... While the complete date() function provides a true array, when i add sum function in the array it gives me #value... i tried the sum(if()) array notation also but it ...

Autofill spreadsheet of images
Hope I've got the right thread.... I have a folder of 120 images that I wish to "insert" into to a spreadsheet. I wish to create a file where the first collumn is the file name and the second collumn is the actual image. Being a naturally lazy person (who isnt?) is there a way of "auto" inserting the file names of a folder and the images? Google is your friend excel:insert images macro http://www.google.com/search?sourceid=navclient&ie=UTF-8&rlz=1T4GFRD_en___US219&q=excel%3ainsert+images+macro -- Don Guillett Microsoft MVP Excel Sale...

Image merge
Hi, I'm attempting to merge images of various sizes into a Publisher file, but the images all resize to the original "placeholder" created when I set up the merge. Is there some way to merge the images and keep them all at their original size? I have over 300 images to merge, and, for obvious reasons, would rather not have to go back and resize them all individually. Thanks, David Publisher is NOT a photo editor. Edit your images in a photo editing program and then move them to Publisher. 300? Have fun. "David" <d_of@yahoo.com> wrote in message news:1143069...

custom chart and image control
I created a chart type that contained an image control (company logo) and a textbox. I saved that chart as a custom chart type. But when I selected that custom chart through the chart wizard in another workbook, the image and textbox controls didn't appear. I even edited with copy and paste those controls directly into xlusrgal.xls where custom chart types are held, but they refused to show up in my charts. Can it be done? and how? PS: I posted this question on the general forum earlier (I don't yet have the reflex to look at other forums. sorry) --- Message posted from http://ww...

Best way to store image, voice, text file?
Hello there, Is it possible to define a sql server field to store image, or voice, or text file? If the size of the file is very big, thus exceeding the max row size 8064 bytes limit, is it better to store it in a directory, and just save the location of the file in the field? Thanks, Ben On Thu, 1 Jul 2010 07:19:54 -0700, Ben <Ben@discussions.microsoft.com> wrote: >Hello there, > >Is it possible to define a sql server field to store image, or voice, or >text file? > >If the size of the file is very big, thus exceeding the max row size 8064...

Building Identical Images
Hi all, I am using Windows CE 6.0 R3 for a medical device and need to be able to build the exact same OS image on a different machine. I cannot even get the same machine to build the same image. The differences are small, which I assume are different timestamps of files within the image. Can someone please point me in the right direction, as I am sure this is not the first time someone has had this problem before, I just could not find anything. Thanks, This thread from the archives is on-topic: http://groups.google.com/group/microsoft.public.windowsce.platbuilder/browse_...

Serializing Array with array "name" in the XML
I need help serializing an array without including the array "name". I am writing in C# and using the XmlSerializer to serial classes. I am trying to serialize a class with an array in it like the one below. public class myclass { public imagecontext; public myimage[] images; } public myimage { public string name; public string path; } It will serialize something like this... <myclass> <imagecontext>my context</imagecontext> <images> <myimage> <name>Image1</name> ...

Images and hyperlinking
is there a way in 2003 (or 2007) for images to rotate based on their record? What I am wanting to do is have images unique only to that record show up on the form. In other words, as I move between record numbers in the form vew, I would like the images to change as well just like the data fields. Thanks!!! ...

loading toolbar images
Hi, Do someone have in their archives a function that pulls bitmap images from a toolbar image? Somthing like: HBITMAP = GetToolbarImage(UINT nToolbar_resource_ID, UINT nImageIndex, ButtonCx, ButtonCy); So if the images were (from left) (0)Cut, (1)Copy, (2)Paste, then GetToolbarImage(ID_TOOLBAR, 2, 16, 15) would fetch the Paste image (zero based index). Like the LoadBitmap(..) function, but from a toolbar image. If not, can somone hint how i can get started on performing this function? joe # OK, i solved my problem, well almost..., i have 2 questions... (1) Is there any way th...

add image and data to table
I need to browse to the image (jpg) and copy it to a know folder. I like the end user to click the browse button and navigate to the image and then click copy, the destination folder is known. After clicking copy another form will launch to add data related to the image to a table. This will add an image and the data to the database. I like to use a form with a browse and copy button. You may find a useful start to what you want to do in the imaging examples at http://accdevel.tripod.com. Larry Linson Microsoft Office Access MVP "rap43" <rap43@discussions.microsoft.com&...

Overcome VBA array size limitation
Hello, I am desperate. I have a dataset which contains 15,000 rows by 25 columns (and I don't want to switch to Access at this point). I desperately need to perform several simple and complex calculations on this dataset and would rather do it by VBA arrays as opposed to ranges. For example I'd rather loop ARRAY(3, i) = ARRAY(1, i) + ARRAY(2, i) and then pass the resulting array to the worksheet than do a thousandfold cell.offset loop. Help please? K I don't understand what you're asking. Alan Beban Francine Kubaka wrote: > Hello, > > I am desperate. ...

USB RNDIS image is not downloading in wince 5.0
Hi, Thanks for all ur great support. Now I got bootme message from my device and my device is detected in PB (target->connectivity options->Ethernet settings). But when i give Target->AttachDevice, the image is not downloading, at that time bootme is transferred to host. i set ip address both side by manually. ping and ipconfig is working perfectly in PC side. Any idea. Regards - D. your device IP address and your PC IP address must be in same subnet. Means if your device IP address is 192.168.0.<some unique value > then your PC IP is also 192.168.0. <...

Background image
Is there a means by which I can add a background image to an excel sheet somehow? -Ike Hi see: http://www.xldynamic.com/source/xld.xlFAQ0005.html -- Regards Frank Kabel Frankfurt, Germany "Ike" <rxv@hotmail.com> schrieb im Newsbeitrag news:U8B8d.5679$gs1.3030@newsread2.news.atl.earthlink.net... > Is there a means by which I can add a background image to an excel sheet > somehow? -Ike > > ...

How do I print a background image in Word 2007 without tile?
Whoever helps me find a solution to this is pretty darn smart. I thought this would be a piece of cake but realize now it's harder than it seems even though it should not. I made a beautiful letterhead for my company but have it in Jpeg So I decided to write a contract on it with word and paste the letterhead as a background I did some searching on how to do this, because as usual, the most simple and obvious option of doing something was not apparent in a Microsoft program :( I tried adding it as a watermark, but you only have options of 50-100-150-200 and 500% an...

CImageList Problem is Baffling Me
Hi guys, Is there any reason why this doesn't work, it's baffling me: // set up a memory DC CDC memDC; CBitmap bitmap; CDC* pDC=GetDC(); memDC.CreateCompatibleDC(pDC); bitmap.CreateCompatibleBitmap(pDC,32,32); CBitmap* pOldBitmap=memDC.SelectObject(&bitmap); // draw some stuff on the bitmap memDC.FillSolidRect(0,0,32,32,RGB(255,192,160)); memDC.FillSolidRect(4,4,24,24,RGB(192,128,160)); // test to see if it works so far pDC->BitBlt(10,10,32,32,&memDC,0,0,SRCCOPY); // it looks good // create my imagelist CImageList imageList; imageList.Create(32,32,ILC_COLOR32,1,1); in...

How can I change the color/type of the borders I put on cells?
When I use the "Cell Border" button on the toolbar to put borders around selected cells, is there a way I can change the color/type of the border lines (for the whole worksheet)? Tools>Options>View and change the colour in the Color dropdown. -- HTH RP (remove nothere from the email address if mailing direct) "Tourkow" <Tourkow@discussions.microsoft.com> wrote in message news:72EDA2CE-6739-434F-A7EA-AF83C7BA9F12@microsoft.com... > When I use the "Cell Border" button on the toolbar to put borders around > selected cells, is there a way I ...

Copying the Pixels of a CBitmap to memory?
Copying the Pixels of a CBitmap to memory? What is the minimal syntax for doing this? I have some code that uses GetDIBits(), but am unsure of exactly what is required, I want to get rid of everything that is not required. Why not show the code you have so we can see if there is any extra stuff there? joe On Sun, 29 Jul 2007 14:27:48 -0500, "Peter Olcott" <NoSpam@SeeScreen.com> wrote: >Copying the Pixels of a CBitmap to memory? >What is the minimal syntax for doing this? > >I have some code that uses GetDIBits(), but am unsure of >exactly what is r...

Named ranges, 3-D ranges, and/or arrays?
Advice is requested: I will have as many as 10 identical worksheets, sales totals of which will need to be aggregated. For example, there will be an identical row ("Total Regional Sales", in 10 different sheets, containing sales BY YEAR 2004 thru 2009. What would be the most efficient and error-free way to aggregate these sales by year in an 11th worksheet? =SUM(Sheet1:Sheet10!A1) etc. -- Vasant "K. Georgiadis" <anonymous@discussions.microsoft.com> wrote in message news:160c701c44767$ec8613f0$a501280a@phx.gbl... > Advice is requested: > I will have as...

How do I deploy a custom web application from image to CRM Server?
We have developed a custom web application in C# that reads information from a database and creates opportunity in MSCRM. The whole thing has been developed in virtual machine. We now need to deploy the custom application from image to test environment in a box installed with SQL 2005 and MSCRM. This web application will be placed in IIS on CRM Server Box. How do I deploy this application from image to CRM Server? ...

How do I get the current memory size of an image?
Hi people, my question is this: How can I get the byte size of an in-memory Bitmap? For example, I want to know that a 100 KB JPEG takes a 2.25 MB of memory space when uncompressed... I tried saving an image to a memory stream and then converting the stream to a byte array and getting the length of the array, but that doesn't produce the correct results... Any ideas? On 28-02-2010 18:40, moss wrote: > my question is this: How can I get the byte size of an in-memory Bitmap? > For example, I want to know that a 100 KB JPEG takes a 2.25 MB of memory > space when uncompresse...

How do I put a marker line on an excel chart (i.e. on y axis)?
How can I put a merker line on an exel line chart (a horizontal line from one value on the y axis to show when values exceed a certain level on y axis)? Hi, You can find details of adding datum lines here http://www.andypope.info/charts/averageline.htm Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "ds8854" <ds8854@discussions.microsoft.com> wrote in message news:15ED7013-A68A-4298-BAFF-1F766C0F3BE6@microsoft.com... > How can I put a merker line on an exel line chart (a horizontal line from > one > value on the y axis to show when val...

C# to C++ with Arrays
Simple C# code: string[] a =3D { "One", "Two" }; object[] b =3D { "One", "Two" }; Converted to C++ code: COleSafeArray a; DWORD elements[1]; elements[0] =3D 2; a.Create(VT_I4, 1, elements); a.PutElement(0, _bstr_t(L"One")); a.PutElement(0, _bstr_t(L"Two")); COleSafeArray b; /* ???? */ They should be identical, but there is something under the hood differen= t = between the two. Eric > They should be identical, but there is something under the hood > different between the two. Replying to my own post... feux paux. ...

Export Publisher logo & text to .jpg file for thumbnail image
Need to download my Publisher logo & text to .jpg file with a physical size of 320 x 120 pixels, which I can then download into a thumbnail image on a busines website. OR is there another way to download my logo & text from Publisher into a .jpg of 320x120 pixels so I can download it into the website? You could open your saved .jpg in a digital image editing program and resize it. The freeware IrfanView may be useful to you... Download IrfanView 3.97 http://www.tucows.com/preview/194967.html (get the plug-ins too) Open the image in Irfanview and go to... Image / Resize-Resample...

Display Image from URL
Hello All, Using Access2007 on a Vista machine. Quarterly, I get a spreadsheed from a manufacturer with a list of current prices, details, etc. One of the fields contains the complete url (http://www.website.com/images/partnumber.jpg) to a photo of each item (1200 items currently supplied), which are hosted on a directory within their website. My database consists of the imported spreadsheet into a table, a query or two and a form. I would like to display the web image on the form for each record. I know how to display an image located on my PC or the company server, but can't seem...

[Newbie] Decoding Base64 element to array of short int, in C#
In my XML document there is an element containing a Base64-encoded array of short (16 bit) integers, e.g., <ShortData Encoding="Base64"> AAAAADQAeAAoABgAQABkAFwAJAAIACgAWAB4AHgAlADYAQQA+ACoAFgA...[etc.] </ShortData> I would like to decode these into an class member declared as an array of short integers, i.e., private short [] _ShortArray; This is because I need to pass this data through COM interop to a method that takes an array of short integers. I can use the Convert.FromBase64String to convert the XML into a byte array, but I need a short-integer array. Do I ne...