Re: ImageList: Is this possible?



"Faraz Azhar" <itz_farazSPAM@xxxxxxxxxxxxxxx> wrote in message
news:OiT09KEVFHA.4000@xxxxxxxxxxxxxxxxxxxxxxx
> Hello
>
> I am thinking of storing all the icons/images used in my application in a
> separate file. That file will not be a dll or exe. It will be a custom
> data
> file in which I will store my images in my own way. Now I want to load
> them
> into the imagelist.
>
> Is it possible to load custom image data into imagelist without creating
> temporary picture files? Normally imagelist can only load data from a file
> path specified to it.. but I am talking about supplying actual binary data
> to the imagelist. Is it possible? Is there any way to create the
> hImageList
> handle (by the way, im creating imagelist through APIs, not using the
> standard control) by supplying binary data to it?
>
> Thank you
>
> Faraz Azhar
>
>
>

There's an API fiunction that lets you create a bitmap in memory:

Declare Function CreateDIBitmap Lib "gdi32" (ByVal hdc As Long, _
lpInfoHeader As BITMAPINFOHEADER, ByVal dwUsage As Long, lpInitBits As
Any, _
lpInitInfo As BITMAPINFO, ByVal wUsage As Long) As Long

Once you have this handle you might be able to pass it to the ImageList - I
am not sure about this part.


--
Peter Aitken

Remove the crap from my email address before using.


.



Relevant Pages

  • Re: ImageList: Is this possible?
    ... > There's an API fiunction that lets you create a bitmap in memory: ... > lpInfoHeader As BITMAPINFOHEADER, ByVal dwUsage As Long, ... lpInitBits As ...
    (microsoft.public.vb.general.discussion)
  • Re: VB3 is making my head spin!
    ... > and displaying it pixel by pixel] tell me how. ... compressed bitmap from an original 24 but full colour bitmap that is held on disk as a standard ... It shows you how to load a full colour 24bit .bmp file from disk and count ... Dim z As Long, t1 As Long, t2 As Long ...
    (comp.lang.basic.visual.misc)
  • Re: Loading image byte array
    ... Thanks Frank, I actually got it working myself before I saw your code. ... load the my image like Michael Phillips suggested. ... at that point Then create a Graphics using a fast-access second bitmap (we ... by pixel over to the byte array. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Large image
    ... The problem there is just trying to load a 3000x3000 bitmap is very likely ... to run the device out of memory long before it's fully in memory. ... templates and full source code then you can buy the SDF Extensions ...
    (microsoft.public.dotnet.framework.compactframework)
  • Twain and Stream questions
    ... load it back from the file into my image control no problem. ... into/out of a stream. ... any ideas on how to load the bitmap directly ... internal static extern int GdipSaveImageToStream(IntPtr image, ...
    (microsoft.public.dotnet.languages.csharp)

Loading