| View previous topic :: View next topic |
| Author |
Message |
Saangyoon Member
Joined: 14 Jul 2006 Posts: 1 Location: the South Korea
|
Posted: 14/07/06 00:25 Post subject: RotateImage changed black |
|
|
Hello,
Thanks for your TRotateImage(V1.52).
TRotateImage is useful to me.
but, I found trouble which image changed black sometimes.
(When both Editing Mode and Runtime mode)
I need to know how to solve this problem, Please.
Thanks
(Delphi 7 Enterprise/ OS: MS-WindowsXPsp2)
when angle was changed 0 deg, it was changed the original state.
but after rotating, image changed black color....
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1113 Location: Tehran, Iran
|
Posted: 04/08/06 13:23 Post subject: |
|
|
Did you check it out with different values of Transparent property? The component uses different methods to draw transparent and opaque images.
_________________ Kambiz |
|
| Back to top |
|
 |
jjoss Member
Joined: 12 Nov 2006 Posts: 6
|
Posted: 12/11/06 17:56 Post subject: Same problem |
|
|
| I have the same problem. After some time image became a black rotating rectangle. I've tried it with transparency true/false. It comes black in both cases.
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1113 Location: Tehran, Iran
|
Posted: 13/11/06 09:04 Post subject: |
|
|
I'll try to resolve the problem.
_________________ Kambiz |
|
| Back to top |
|
 |
jjoss Member
Joined: 12 Nov 2006 Posts: 6
|
Posted: 13/11/06 09:23 Post subject: transparent |
|
|
I have some more information. It seems to happen when I used gif with transparency. Even when I set Transparent property to False. Image is attached (arrow.gif). Yesterday evening I tried to convert the image to jpeg and haven't seen the problem for an half an hour run. While with gif it appeared in 5-10 minutes of run. So I assume this happens only when an image has transparency. Maybe pallette is broken.
And one more thing that could help. Image becomes not purely black. I saw some dark-grey shadows of an arrow contour. It seems that image bits are there, but something happens with colors.
| Description: |
|
| Filesize: |
1.49 KB |
| Viewed: |
537 Time(s) |

|
|
|
| Back to top |
|
 |
Johnny_Bit Administrator
Joined: 15 Jun 2003 Posts: 347
|
Posted: 13/11/06 14:45 Post subject: |
|
|
| Hmm... maybe for advanced graphics support (like transparent gif, pngs, or others) we should consider using GraphicEx or something like that, maybe that would help. Extreme way around this is write own handlers for graphic files.
|
|
| Back to top |
|
 |
jjoss Member
Joined: 12 Nov 2006 Posts: 6
|
Posted: 18/01/07 20:48 Post subject: Any news? |
|
|
| Kambiz wrote: | | I'll try to resolve the problem. |
Have you managed to solve the problem. I've tried different ways, saved my picture in jpg, bmp, gif, with different palettes, with and without transparancy. But I can't get rid of this black rectangle!
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1113 Location: Tehran, Iran
|
Posted: 19/01/07 00:14 Post subject: |
|
|
I think that I could resolve the issue. Please download the update and let me know about the result.
As a hint, in Delphi 7 with XP Themes active, if you put RotateImage (or other transparent control) on a panel, set the panel's ParentBackground property to False.
_________________ Kambiz |
|
| Back to top |
|
 |
jjoss Member
Joined: 12 Nov 2006 Posts: 6
|
Posted: 20/01/07 17:55 Post subject: Range check error |
|
|
Now I get a range check error on line 245 of RotImg.pas
Which is correct way to update the component? I just updated all files from the .zip in my borland/lib folder and deleted .dcu files.
|
|
| Back to top |
|
 |
Johnny_Bit Administrator
Joined: 15 Jun 2003 Posts: 347
|
Posted: 20/01/07 19:00 Post subject: |
|
|
| Oh! Man, I wouldn't do it that way, better way around is to have components placed into separate folders build independently and so on. That way you won't run into trouble. now from my experience either you blew the installation or Kambiz messed some thing's up. Because latter is less possible I say check again.
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1113 Location: Tehran, Iran
|
Posted: 20/01/07 22:28 Post subject: |
|
|
Johnny_Bit is absolutely right.
In the other hand, range check is set off inside DELPHIAREA.INC. Therefore, if you was installed and built the component correctly, you should not get a range ckeck error at all.
_________________ Kambiz |
|
| Back to top |
|
 |
jjoss Member
Joined: 12 Nov 2006 Posts: 6
|
Posted: 21/01/07 09:40 Post subject: Nope :( |
|
|
Kambiz, unfortunately, I see the same problem. Now I'm absolutely sure that I have version 1.53. But the problem still exists.
I have rather complicated multithreaded app which works with serial port. As for form design, RotateImage is placed on a panel, which is placed on a page control, which is placed on a panel on the main form. All panels have ParentBackground = false and I don't use XP style. Delphi 7. WinXP has all current updates.
Currently I've made a workaround with your ImageWork. So this is not very urgent for me.
Instead of | Code: | | ImageAngle.Angle := 360-Angle; | I use
| Code: | ImageWork.Transform.Rotation := 360-Angle;
ImageWork.ApplyTransform(ImageAngleSource.Picture.Graphic);
ImageAngle.Picture.Assign(ImageWork.Output); |
It works fine.
By the way, is that correct? I worry about correct usage to avoid mem leaks.
And another related question. Is there an easy way to avoid image flickering?
PS
Possibly, I could send you my app, but I'm not sure I can extract only the code related to RotateImage.
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1113 Location: Tehran, Iran
|
Posted: 21/01/07 14:23 Post subject: |
|
|
Your code to use ImageWork is correct. Of course, recently I've made some improvements in the ImageWork package, that is not released on the website. Remember if you upgraded to the new release of ImageWork, you must adapt your code.
Regarding to flickering, put your image control (TImage or TRotateImage) on a panel, the on OnCreate of your form set the panel's DoubleBuffered property to True.
Let's back to RotateImage issue. Did you test your image with RotateImage demo? If you tell me how to regenerate the problem using the demo program, I find a way to fix it. However, I still believe thetre's something wrong in your code, because I do not see any problem in the demo. I do suggest to:
- Close Delphi 7
- Delete all RotateImage files (be sure no dcu is left hidden somwhere)
- Download RotateImage again
- Extract the zip file in directroy "MyLib" under Delphi7 directroy
- Run Delphi 7
- Select "Component/Install Component" from the Delphi's menu bar
- Go to "Into new package" tab
- For "unit file name" field, click browse and select "RotImg.pas" and "RotImgReg.pas" from "MyLib" directory
- Append ";$(DELPHI)\MyLib" to "Search path" field.
- Enter "MyPackage.dpk" for "Package file name"
- Enter "My Miscellaneous Components" as "Package description"
- Click "OK" button and confirm the next dialog.
Later, you can open "MyPackage.dpk" and add other components to the package and re-build it.
_________________ Kambiz |
|
| Back to top |
|
 |
jjoss Member
Joined: 12 Nov 2006 Posts: 6
|
Posted: 22/01/07 08:34 Post subject: Seems to be fine now! |
|
|
Kambiz, thanks a lot!
I've tried it yesterday evening and haven't seen the black rectangle. I'll try some more, but hope that this bug is gone. Strange that component was not updated on my first attempt. I removed all RotImg*.* files.
Again, thanks for your responce and advices!
|
|
| Back to top |
|
 |
|