1. Resizing bmp/jpg images

I am attempting to display either bmp or jpg images on a window.
Have been able to load and display an image on the window where required
but cannot resize the image to fit in the area allowed of 220x190 pixels.
Is there any way under Euphoria to shrink/expand images to any size?.
I know there is an API which is reported to do this but it requires a file
name as a string. I searched the win32lib but could not see any direct
reference to this API. (LoagImageA from Windows User32 dll)
Regard Reg.

new topic     » topic index » view message » categorize

2. Re: Resizing bmp/jpg images

Reginald Venaglia wrote:
> 
> I am attempting to display either bmp or jpg images on a window.
> Have been able to load and display an image on the window where required
> but cannot resize the image to fit in the area allowed of 220x190 pixels.
> Is there any way under Euphoria to shrink/expand images to any size?.
> I know there is an API which is reported to do this but it requires a file
> name as a string. I searched the win32lib but could not see any direct
> reference to this API. (LoagImageA from Windows User32 dll)

For Windows platforms you need to look at the stretchBlt function.

An example can be found in the demo program that comes with win32lib,
"bkGnd16.exw"

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

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

3. Re: Resizing bmp/jpg images

> I am attempting to display either bmp or jpg images on a window.
> Have been able to load and display an image on the window where required
> but cannot resize the image to fit in the area allowed of 220x190 pixels.
> Is there any way under Euphoria to shrink/expand images to any size?.
> I know there is an API which is reported to do this but it requires a file
> name as a string. I searched the win32lib but could not see any direct
> reference to this API. (LoagImageA from Windows User32 dll)

Check out stretchBlt(). I believe its built into Win32Lib 0.59 and up.

~Greg

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

4. Re: Resizing bmp/jpg images

Reginald Venaglia wrote:
> 
> I am attempting to display either bmp or jpg images on a window.
> Have been able to load and display an image on the window where required
> but cannot resize the image to fit in the area allowed of 220x190 pixels.
> Is there any way under Euphoria to shrink/expand images to any size?.
> I know there is an API which is reported to do this but it requires a file
> name as a string. I searched the win32lib but could not see any direct
> reference to this API. (LoagImageA from Windows User32 dll)
> Regard Reg.

The API function CopyImage() will make a copy of an Icon, Bitmap, or Cursor,
given it's handle. There is an option to resize the image to a given width and
height.

Larry Miller

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

5. Re: Resizing bmp/jpg images

HI there,

Just to note, my "WinClass" library comes with a file Bitmaps.ew
that has a function in it that loads a bitmap file and resizes it
all in one operation so it's pretty fast.
This is mainly for use when you have a bitmap that resides in
a file and you need to load it and have it display in a given part
of the screen without going through too much trouble.


Take care,
Al

E boa sorte com sua programacao Euphoria!


My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

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

6. Re: Resizing bmp/jpg images

Hello Reggie,

See Deluxe Slide Show in the archives. (Writtem by Me and Al Getz, of course)
 It is written in WinClass but the size adjustments are the same for Win32lib.

It does exactly what you want, it changes to full screen size rather than
220x190 pixels.

Don Cole

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

Search



Quick Links

User menu

Not signed in.

Misc Menu