Like this:
local pixels = { 0,50,210,40,40,40,40,40,40, ...} -- format RRRRR...
GGGGG... BBBB... and bottom-up orientation
local image = im.ImageCreate(width, height, im.RGB, im.BYTE)
image:SetPixels(pixels)
or
local pixels = { 0,50,210,40,40,40,40,40,40, ...} -- format RRRRR...
GGGGG... BBBB... AAAA... and bottom-up orientation
local image = im.ImageCreate(width, height, im.RGB, im.BYTE)
image.AddAlpha()
image:SetPixels(pixels)
To simplify this I added IupImageToImImage to SVN.
Best,
Scuri
On Tue, Jan 24, 2017 at 1:00 PM, Milind Gupta <milind.gu...@gmail.com>
wrote:
> Hi Antonio,
> How do I specify an IM image in lua? I prefer not to load it from a
> file. Currently I have the image defined using iup.imagergb. I could not
> find an equivalent thing to do for an imimage.
>
> Thanks,
> Milind
>
> On Jan 24, 2017 4:42 AM, "Antonio Scuri" <antonio.sc...@gmail.com> wrote:
>
>> Hi,
>>
>> I suggest you to use another approach. Save that image in a regular
>> file format, like PNG, then load the image using IM, and use the available
>> functions to convert that image to an IupImage every time you need to
>> change its size.
>>
>> If your image is in Lua, you can also specify an IM image in Lua.
>>
>> Best,
>> Scuri
>>
>>
>> On Mon, Jan 23, 2017 at 6:25 PM, Milind Gupta <milind.gu...@gmail.com>
>> wrote:
>>
>>> Hi,
>>> I have a image on a label on one of my dialogs. I want to resize
>>> the image when the dialog is resized to fill the growing size of the label.
>>> To do this I was looking to convert the iup image to IM image so I can use
>>> the resize operation and then convert the image back to iup image and fill
>>> the label.
>>> I see the function ImageFromImImage but I do not see the reverse.
>>> I tried GetNativeHandleImage but that gies the bad argument error if I pass
>>> it the iup image. So how can I convert the iup image to im image?
>>>
>>> Thanks,
>>> Milind
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Iup-users mailing list
>>> Iup-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>>
>>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Iup-users mailing list
>> Iup-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>
>>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users