DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RotateImage changed black

 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
Saangyoon
Member


Joined: 14 Jul 2006
Posts: 1
Location: the South Korea

PostPosted: 14/07/06 00:25    Post subject: RotateImage changed black Reply with quote

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


Embarassed
Back to top
View user's profile Send private message Send e-mail
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1113
Location: Tehran, Iran

PostPosted: 04/08/06 13:23    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
jjoss
Member


Joined: 12 Nov 2006
Posts: 6

PostPosted: 12/11/06 17:56    Post subject: Same problem Reply with quote

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
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1113
Location: Tehran, Iran

PostPosted: 13/11/06 09:04    Post subject: Reply with quote

I'll try to resolve the problem.
_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jjoss
Member


Joined: 12 Nov 2006
Posts: 6

PostPosted: 13/11/06 09:23    Post subject: transparent Reply with quote

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.



arrow.gif
 Description:
 Filesize:  1.49 KB
 Viewed:  533 Time(s)

arrow.gif


Back to top
View user's profile Send private message
Johnny_Bit
Administrator


Joined: 15 Jun 2003
Posts: 347

PostPosted: 13/11/06 14:45    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
jjoss
Member


Joined: 12 Nov 2006
Posts: 6

PostPosted: 18/01/07 20:48    Post subject: Any news? Reply with quote

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
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1113
Location: Tehran, Iran

PostPosted: 19/01/07 00:14    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
jjoss
Member


Joined: 12 Nov 2006
Posts: 6

PostPosted: 20/01/07 17:55    Post subject: Range check error Reply with quote

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
View user's profile Send private message
Johnny_Bit
Administrator


Joined: 15 Jun 2003
Posts: 347

PostPosted: 20/01/07 19:00    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1113
Location: Tehran, Iran

PostPosted: 20/01/07 22:28    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
jjoss
Member


Joined: 12 Nov 2006
Posts: 6

PostPosted: 21/01/07 09:40    Post subject: Nope :( Reply with quote

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
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1113
Location: Tehran, Iran

PostPosted: 21/01/07 14:23    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jjoss
Member


Joined: 12 Nov 2006
Posts: 6

PostPosted: 22/01/07 08:34    Post subject: Seems to be fine now! Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group