How do you use the FF3 Picture Control? I have been searching for help an documentation.
I want to use it the same way a VB Picturebox control is used. so I would need handles to the control, the bitmap data, and DC. I read that this control is *NOT* like the PB GRAPHIC control. Any tips on this?
See this message:
http://www.planetsquires.com/protect/forum/index.php?topic=2134.msg17935#msg17935
in this discussion:
http://www.planetsquires.com/protect/forum/index.php?topic=2134.msg17974#msg17974
Once set up you can use the normal PB graphic commands.
Ian.
Ugly..
So you create a FF3 form.. drop a ff3 custom graphics control on it.. *THAT YOUR NOT GOING TO USE*
Only to create a PB9 Dialog, and GRAPHIC control on your ff3 form? Just so you can use the commands already provided in PB9 to draw on the graphics control?
Does this really counts as answering the question of how to use the FF3 Picture control?
I ran a quick test.. It works just as a VB Picture box control. It responds to WindowsAPI commands. Thats all I needed. I haven't tried to SetDIBits, but I was able to getDC and draw..
Perfect for my needs..
On second inspection..
The Picture Control doesn't seem to work very well.
1) When the form starts the control has a white background. (but it shows through to what is behind the form)
2) I can't resize or do anything to the Picture control.. (seems to be dead..) I have Jose includes but nothing seems to be working.
3) I can draw on the picture box, but nothing else..
I am confused because there is a GraphCtx and a PictureCtx include headers with no explanation of what is actually being used in FF3? - This is really getting frustrating..
Quote from: Exploration Gaming on November 28, 2010, 02:18:39 PM
The Picture Control doesn't seem to work very well.
The Picture control works exactly as it's supposed to. It displays pictures - in this case, bitmaps or icons. The FireImage control displays those image types and several others.
The Picture Control in FF3 is not like the pictures control in VB. Trying to showhorn those VB concepts in the FF3 control is the problem.
Quote
1) When the form starts the control has a white background. (but it shows through to what is behind the form)
2) I can't resize or do anything to the Picture control.. (seems to be dead..) I have Jose includes but nothing seems to be working.
3) I can draw on the picture box, but nothing else..
You should probably post some sample code of what you are doing because the control can be resized easily.
Quote
I am confused because there is a GraphCtx and a PictureCtx include headers with no explanation of what is actually being used in FF3? - This is really getting frustrating..
Where are you getting the GraphCtx and a PictureCtx include headers in FF3? FF3 does not ship with those headers - did you manually add them to the project? Those controls were written by Jose Roca a couple of years ago. FF3 does not come packaged with those controls.
GraphCtx is a graphic control packaged, with some others, with my Windows API Headers. They are intended to be used manually, not dragging and droping them in a form. For drag and drop use, Paul will have to write a DLL version of it and a .CTL file.
Ok.. I thought it was my fault but its clearly not working..
1. Drop a Picture control on the dialog.
2. Made sure the resize rules were set.. "S,S,S,S"
And even when I manually resize the dialog the picture box will not resize.. (Only move)
I used the code.. (under a button)
FF_Control_SetSize HWND_FORM1_PICTURE1, 256, 256 and nothing happens..
I have a Listbox on the same dialog, same settings and it resizes without a problem.
You may need to post a sample project showing the problem. I have posted an extremely simple project showing that the functionality works (unless I am misunderstanding what you are trying to do).
I assigned a bitmap to the picture control but it also works with an icon (picture controls can only be icons or bitmaps).
The only "problem" is that if you use the ResizeRules then the control will resize as you manually resize the Form, however, if you programically resize the control and then subsequently try to resize via the Form then the picture will reset to it's previous size prior to invoking the ResizeRules. You can see that effect in the sample project by clicking on the CommandButton and then trying to manually resize the Form.
Do you have code elsewhere in your project that is interfering with the Resize? Maybe in WM_SIZE or even WM_PAINT?
Also, I assume that you have unchecked the "Do not resize this control" checkbox in the ResizeRules dialog.
Ok.. First.. The picturebox needs an image loaded in order to resize. You can't just drop a picture box and resize it.. (empty)
This should be fixed, because if you drop a picture box on a Dialog, it actually make a hole in the Dialog. (You can literally see the text behind the dialog.) - If no picture is set on the picture box, the FF_Control_SetSize function fails, but the move works..
I used your project. It worked.. and then when I detached the image it fails... (I never had an image attached on my project.)
Tye
"The picturebox needs an image loaded in order to resize. You can't just drop a picture box and resize it.. (empty)"
This is not true per Paul's attached project. Detach the picture and set the WS_EX_CLIENTEDGE and you will see it resize even without image loaded. You can try other way - like change the backcolor of the form while the picturebox retain the button-face backcolor. Otherwise, without a visible edge, you can't see the picturebox resizing.
"This should be fixed, because if you drop a picture box on a Dialog, it actually make a hole in the Dialog. (You can literally see the text behind the dialog.)"
I don't see a hole or transparent. I see the button-face opaque backcolor.
Okay, there was no image.... ah, that could make a difference because I assume that the STATIC class is merely painting a null brush rather than the picture itself. That's why it would appear that the space is empty or a hole.
If there is no image then your best bet is to just hide the control until such time that you want to assign a picture to it.
You should also realize that the FF Picture Control is a standard Windows control (of calss, STATIC) that merely displays icons or bitmaps using Windows built in api's. There is nothing magical or different that FF is doing to the control (unlike the FireImage control which is a custom control that I wrote).
....or you could create a blank image. Say, a bitmap that is all gray or whatever color, and display that picture when you want the control to appear to be blank. You can then switch to whatever picture you need to afterwards.
Cho Sing Kum,
I did just as you said, and it doesn't resize.Maybe its only on Windows2000. I am using his attached project, and there appears to be a hole in the form. The resize doesn't work unless there is an image.
I have made a blank.bmp as a place holder..
Thanks,
Tye