1. Resizing pictures

Hello,
I have several pictures and they are of different sizes, Is ther a 
procedure to display the pictures  so they appear to be the same size or 
convert them  to the same size?
Thanks for any suggestions.
Jvandal

new topic     » topic index » view message » categorize

2. Re: Resizing pictures

On Thu, 02 Dec 2004 22:53:21 -0700, sixs <sixs at ida.net> wrote:
> Hello,
> I have several pictures and they are of different sizes, Is ther a
> procedure to display the pictures  so they appear to be the same size or
> convert them  to the same size?
> Thanks for any suggestions.
> Jvandal

There is a C function called StretchBlt... look for references to it
in the archives, my memory isn't want it used to be.


-- 
MrTrick

new topic     » goto parent     » topic index » view message » categorize

3. Re: Resizing pictures

Thanks to you and Patrick Barnes for your help. I could get your test to 
run ok with my pictures. I have moved your test.ex code to a windows 
program and tried to run. I have trouble with the Init instruction. It 
checks the first statement and aborts. I mcopied the CXimage .ex and the 
Cximage.dll to the folder wher my program resides. I then moved them to 
the  include folder in Euphoria folder and I still bomb off on the 
initialization  statement. I haven't used the dll files too much so I'm 
not sure. Could it be windows on XP ?
Anymore help would be appreciated
Thanks to all
jvandal

mic _ wrote:

>
> The code below is a program i wrote using my CxImage wrapper 
> (available in the archives) that takes every BMP file in the current 
> directory, resizes them and saves them as PNG (you could save them in 
> BMP, JPG or something else).
>
>
> <begin code>
>
> include cximage.ew
> include file.e
> include machine.e
> include get.e
> include misc.e
>
>
> constant INITIALDIR = current_dir()
> constant s = dir(INITIALDIR&"\\*.bmp")
>
> atom image
>
> -- Initialize the CXI library
> if not CXI_Init() then
>     abort(0)
> end if
>
> for i=1 to length(s) do
>     if length(s[i][D_NAME])>4 then
>
>     -- Load an image from file
>     image = CXI_LoadImage(INITIALDIR&"\\"&s[i][D_NAME], 
> CXI_FORMAT_UNKNOWN, 0)
>
>     -- Abort if the image couldn't be loaded
>     if not image then
>         abort(0)
>     end if
>
>        CXI_Resize(image, 320, 240, CXI_GOOD_RESIZE)
>
>     -- Save a copy of the image as PNG
>     if CXI_SaveImage(image, 
> INITIALDIR&"\\"&s[i][D_NAME][1..length(s[i][D_NAME])-3]&"png", 
> CXI_FORMAT_PNG) then
>     end if
>
>     -- Destroy the resources allocated for the image
>     CXI_FreeImage(image)
>     end if
> end for
>
> <end code>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu