Loading JPEG images into FireImage controls dynamically

Started by Barry Marks, November 14, 2009, 10:42:59 PM

Previous topic - Next topic

Barry Marks

I've been playing with the FireImage control with JPG files and I'm very glad to have that.  However, I don't see any clues on how to dynamically load a JPG into the control.  Is there some help on this?  I didn't find any.

If this will be coming in the not too distant future in the educational stuff you talked about I'm happy to wait.  I'm just playing with things to try to figure out how to use all this.

Barry

Paul Squires

The message equates are listed in the FireImage.inc file.


%FIREIMAGE_SETIMAGENORMAL = %WM_USER + 100  ' Normal image
%FIREIMAGE_SETIMAGEHOT    = %WM_USER + 101  ' Hot Image
%FIREIMAGE_SETIMAGEDIS    = %WM_USER + 102  ' Disabled
%FIREIMAGE_SETFITSTYLE    = %WM_USER + 103  ' Autosize, Actual size, etc..
%FIREIMAGE_SETBACKCOLOR   = %WM_USER + 104  ' Back color when image does not fill entire window

%FIREIMAGE_AUTOSIZE       = 0    ' Autoadjusts the image to the width or height of the control
%FIREIMAGE_ACTUALSIZE     = 1    ' Shows the image with its actual size
%FIREIMAGE_FITTOWIDTH     = 2    ' Adjusts the image to the width of the control
%FIREIMAGE_FITTOHEIGHT    = 3    ' Adjusts the image to the height of the control
%FIREIMAGE_STRETCH        = 4    ' Adjusts the image to the height and width of the control

%FIREIMAGE_LOADRESOURCE   = 0
%FIREIMAGE_LOADFILE       = 1
%FIREIMAGE_LOADSTRING     = 2


To set the normal image from a disk file:
sFilename = "MyPicture.jpg"
SendMessage HWND_FORM1_FIREIMAGE1, %FIREIMAGE_SETIMAGENORMAL, %FIREIMAGE_LOADFILE, StrPtr(sFilename)
SendMessage HWND_FORM1_FIREIMAGE1, %FIREIMAGE_SETFITSTYLE, %FIREIMAGE_STRETCH

Paul Squires
PlanetSquires Software

Jean-pierre Leroy

#2
Barry,

I've just uploaded a sample FireFly project called FireImageDemo to illustrate some aspects of the FireImage control.

I hope it could be of some help.

http://www.planetsquires.com/protect/forum/index.php?topic=2063.0

Jean-Pierre

Ivan Iraola

I haven't played much with pictures yet, but I have a question, how do you place a picture as the form background?
Android App Developer
http://www.uncledroid.com

Marc van Cauwenberghe

Hello Ivan. I think you have to use the BackBitmap property of the form.

Marc

Ivan Iraola

Quote from: Marc van Cauwenberghe on November 15, 2009, 10:59:53 AM
Hello Ivan. I think you have to use the BackBitmap property of the form.

Marc

Yes, but we are talking able to change it dynamicaly.
Android App Developer
http://www.uncledroid.com

Marc van Cauwenberghe


Barry Marks

Quote from: Jean-Pierre Leroy on November 15, 2009, 06:04:42 AM
I've just uploaded a sample FireFly project called FireImageDemo to illustrate some aspects of the FireImage control.

I hope it could be of some help.

Thanks.  I just ran it and it seems to do what I was asking about and even some of the stuff I'd probably have asked about next. :)

Now all I have to do is try to understand it.  I've been doing graphics with DDT and this SDK stuff is different.  I've been wanting to be able to use JPG for some time.

Barry

Barry Marks

Quote from: TechSupport on November 14, 2009, 11:57:38 PM
The message equates are listed in the FireImage.inc file.

Thanks.  I'll study this and play with it.  A lot of what I do involves simple graphics.

I should have thought to look for an include file for the controls but I didn't.

Barry

Jean-pierre Leroy

#9
Paul,

Once a picture is loaded on the FireImage control, what sort of message can I send to the FireImage control to reset it ? (in order to have the control in his initial state without any picture).

Thanks,
Jean-Pierre