Re: BMP to JPG (again)



Cool, thank you!

Question:
---------
MSDN says about "SHLoadImageFile": [...]Converts a .gif file to a
bitmap.[...]
Now i know it also can load a BMP :-)

How did you know about this function(s) if you just knew, that you like to
load a BMP but didn' know if there's a MS-DLL available with some function
to do that?

And: my biggest problems with P/Invoke is, that i don't know which .Net
type/class is compatible to some C++ declaration/parameter in the
parameters. Is there something like a list or a documentation about this?

Boris

On Wed, 27 Apr 2005 12:37:17 +0300, Sergey Bogdanov wrote:

> I was using SHLoadImageFile [1] just for simplicity. It loads image file
> and returns its HBITMAP which I pass to WriteBitmapIntoJpegFile.
>
> To convert byte array with image into JPG file you have to use
> WriteRGBBytesIntoJpegFile P/Invoke. The last parameter is an array with
> length equals to height * width * 3 (where 3 bytes is RGB). I have
> updated JpegTest [2] now it also demonstrates how to use
> WriteRGBBytesIntoJpegFile function.
>
> [1]
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/apippc/html/ppc_aygshell_thcu.asp
> [2]
> http://www.sergeybogdanov.com/Samples/JpegTest.zip
>
> Best regards,
> Sergey Bogdanov
> http://www.sergeybogdanov.com
>
>
> Boris Nienke wrote:
>> Thanks a lot!
>> I will look deeper into it when i'm back home.
>>
>> Currently i wonder what "SHLoadImageFile" exactly is/does and if it's
>> possible to do convertion to JPG with an in-memory bitmap. I will see
>>
>> Boris
>>
>> On Tue, 26 Apr 2005 19:35:39 +0300, Sergey Bogdanov wrote:
>>
>>
>>>I have written wrapper for IJG and now you can convert BMP file into JPG
>>>file. How it could be done see this example:
>>>http://www.sergeybogdanov.com/Samples/JpegTest.zip
>>>
>>>Best regards,
>>>Sergey Bogdanov
>>>http://www.sergeybogdanov.com
>>>
>>>
>>>Boris Nienke wrote:
>>>
>>>>yes - that's what i find whenever i start a new search about this topic.
>>>>
>>>>But isn't there anyone who has done this allready?
>>>>A DLL or something with some wrapper-class to do this with C#?
>>>>
>>>>I'm not a C/C++ guru - so writing a "wrapper around IJG" is not that easy
>>>>for me.
>>>>
>>>>I'm still hoping that someone out there has done this successfully and like
>>>>to share <hope hope hope> :-)
>>>>
>>>>Boris
>>>>
>>>>On Mon, 25 Apr 2005 16:54:38 +0300, Sergey Bogdanov wrote:
>>>>
>>>>
>>>>
>>>>>See this article:
>>>>>http://www.pocketpcdn.com/articles/savejpeg.html
>>>>>
>>>>>You might try to write wrapper around IJG library and then using
>>>>>P/Invoke call required methods to convert BMP to JPEG.
>>>>>
>>>>>Best regards,
>>>>>Sergey Bogdanov
>>>>>http://www.sergeybogdanov.com
>>>>>
>>>>>
>>>>>Boris Nienke wrote:
>>>>>
>>>>>
>>>>>>On Fri, 22 Apr 2005 08:54:41 +0200, Boris Nienke wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hi,
>>>>>>>
>>>>>>>is there a function available (C# wrapper or something) to convert BMP file
>>>>>>>to a JPG file?
>>>>>>>i think i ask this once a year at least ;-) but i'm still hoping :)
>>>>>>>
>>>>>>
>>>>>>
>>>>>>Really no solution yet available?
>>>>>>Hard to believe....
>>>>>>
>>>>>>Boris
.



Relevant Pages

  • Re: Two more questions: sounds and JPG.
    ... This will allow you to load a gif, png, jpg, bmp... ... the decoding codes which it should) ... How can I load from file an image different from bitmap (i.e. JPG)? ...
    (microsoft.public.windowsce.embedded.vc)
  • Getting the pixel color of an image at a particular coordinate...
    ... I have a requirement to load a Black & White ... image (could be either a JPG or a BMP) and find out the the color of certain ... pixels at certain fixed coodinates. ...
    (microsoft.public.vb.winapi.graphics)
  • RE: stego and executable files
    ... Hiding executables in the JPEG implies that whatever you use to read the ... to demostrate on JPG and BMP picture formates, ... Now to the structure of BMP files. ... Now JPG has structure more suitable for storage, ...
    (Security-Basics)
  • Re: Rapid gfx display Qs
    ... I think with Autoredraw False you are effectively timing the total time both of loading the picture from disk into memory and also the time taken for the OS to dump that picture to the screen. ... In contrast, with Autoredraw True, you are timing only the time taken to load the picture from disk into memory because the VB Autoredraw system itself will dump the property to the actual display just after your code has finished. ... I get a time of about 79 msecs just to load the picture into a StdPicture object, even though the file size of the jpg is very much smaller, only about one tenth of the file size of the equivalent bmp. ... Much of course depends on the nature of your images, and it is hard to comment any further really without knowing what sort of images they are. ...
    (microsoft.public.vb.general.discussion)
  • Re: AMD64 much slower than i386 on FreeBSD 5.4-pre
    ... > load rose with an 64bit system. ... Boris was just trolling because he has not responded, ... Since I don't have a amd64 system, ... Ofcourse some hardware info would ...
    (freebsd-questions)

Loading