RotateImage changed black

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

RotateImage changed black

Postby Saangyoon » July 14th, 2006, 12:25 am

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....


:oops:
Saangyoon
Member
Member
 
Posts: 1
Joined: July 14th, 2006, 12:09 am
Location: the South Korea

Postby Kambiz » August 4th, 2006, 1:23 pm

Did you check it out with different values of Transparent property? The component uses different methods to draw transparent and opaque images.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Same problem

Postby jjoss » November 12th, 2006, 5:56 pm

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.
jjoss
Active Member
Active Member
 
Posts: 6
Joined: November 12th, 2006, 5:53 pm

Postby Kambiz » November 13th, 2006, 9:04 am

I'll try to resolve the problem.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

transparent

Postby jjoss » November 13th, 2006, 9:23 am

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.
Attachments
arrow.gif
arrow.gif (1.49 KiB) Viewed 6386 times
jjoss
Active Member
Active Member
 
Posts: 6
Joined: November 12th, 2006, 5:53 pm

Postby Johnny_Bit » November 13th, 2006, 2:45 pm

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.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Any news?

Postby jjoss » January 18th, 2007, 8:48 pm

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!
jjoss
Active Member
Active Member
 
Posts: 6
Joined: November 12th, 2006, 5:53 pm

Postby Kambiz » January 19th, 2007, 12:14 am

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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Range check error

Postby jjoss » January 20th, 2007, 5:55 pm

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.
jjoss
Active Member
Active Member
 
Posts: 6
Joined: November 12th, 2006, 5:53 pm

Postby Johnny_Bit » January 20th, 2007, 7:00 pm

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.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby Kambiz » January 20th, 2007, 10:28 pm

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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Nope :(

Postby jjoss » January 21st, 2007, 9:40 am

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: Select all
ImageAngle.Angle := 360-Angle;
I use
Code: Select all
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.
jjoss
Active Member
Active Member
 
Posts: 6
Joined: November 12th, 2006, 5:53 pm

Postby Kambiz » January 21st, 2007, 2:23 pm

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:

  1. Close Delphi 7
  2. Delete all RotateImage files (be sure no dcu is left hidden somwhere)
  3. Download RotateImage again
  4. Extract the zip file in directroy "MyLib" under Delphi7 directroy
  5. Run Delphi 7
  6. Select "Component/Install Component" from the Delphi's menu bar
  7. Go to "Into new package" tab
  8. For "unit file name" field, click browse and select "RotImg.pas" and "RotImgReg.pas" from "MyLib" directory
  9. Append ";$(DELPHI)\MyLib" to "Search path" field.
  10. Enter "MyPackage.dpk" for "Package file name"
  11. Enter "My Miscellaneous Components" as "Package description"
  12. 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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Seems to be fine now!

Postby jjoss » January 22nd, 2007, 8:34 am

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!
jjoss
Active Member
Active Member
 
Posts: 6
Joined: November 12th, 2006, 5:53 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 2 guests