×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    91

    fillRect() is not supporting

    Hello,
    I come across fillRect() problem on Samsung GT s5250.
    When I test below snippet of code
    Code:
      graphics.setColor(0xFF0000);
      graphics.fillRect(0, 0, getWidth(), getHeight());
    It's glitches; mean screen is not painting properly.
    Anyway, I got workaround for that is fillRoundRect(); below snippet of code working as such
    Code:
    g.fillRoundRect(0, 0, getWidth(), getHeight(),0,0);
    But still I have a anxiety about it.
    Is it because of device firmware?
    If, then how I get it from J2ME;please don't let me know about "microedition.platform".
    Since, we can't get it using this.

    Hope I have been elaborated my problem up to understanding level.

    In brief, I would like to say that fillRect() is not painting as such whereas fillRoundRect() is.


    Cheers,
    Amit

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: fillRect() is not supporting

    Can you fillRect() a small shape? Say, (0, 0, 10, 10)?

    Graham.

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    91

    Re: fillRect() is not supporting

    Hello Graham,
    It has been observed that with "fillRoundRect()" it's working fine! Whereas with "fillRect" it paints screen in a different way like;
    If you paint a area with (10, 10) or (20, 20) then instead smooth painting we can be able to see lots of small square with in it (might be they are pixels) and
    If you paint with (50, 50) then after a particular height it draw a line also in a specified region.
    But if we do that same with "fillRoundRect() with arc value 0,0; we will get a single square/rectangle what we desire.

    Hope it'll be helpful in order to explain my problem.




    Amit.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: fillRect() is not supporting

    Quote Originally Posted by amit_yadav View Post
    If you paint a area with (10, 10) or (20, 20) then instead smooth painting we can be able to see lots of small square with in it (might be they are pixels)
    If you're seeing a kind of "chessboard" pattern, of two very similar colours, this is quite common on older Samsung devices, so it doesn't surprise me that it's still a problem. You will probably find that some colours do paint a smooth, solid area.

    Quote Originally Posted by amit_yadav View Post
    Hope it'll be helpful in order to explain my problem.
    The explanation is simple: the implementation of fillRect() on that device is buggy. This is a pretty familiar experience to anyone porting to Samsung devices.

    The fix... well, the fix is to find another method of drawing a rectangle that works. It sounds like you've found one. There will be other techniques, such as using drawLine(), drawImage(), drawRGB(), fillTriangle(), etc. Then, replace every call to fillRect() with your replacement code fragment. This is the same process for coping with any defective API implementation.

    Some strategies for dealing with issues like this are described in the wiki.

    Graham.

  5. #5
    Registered User
    Join Date
    May 2007
    Posts
    91

    Re: fillRect() is not supporting

    Hello Graham,
    It’s really great that you have visualized and put your experienced concern over it without any snapped of it; I agree with it! And yes we'll have to go with workaround "fillRoundRect()".
    One thing more, sometimes I have been seen to be fixed a particular problem (related to Interrupt/sound/Graphics etc) with firmware update. Since I would like to know that is there any approach to get device firmware?

    Amit.

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: fillRect() is not supporting

    Some manufacturers (for some devices) provide firmware updates directly to end users. For some, you will need to download an update utility (see the manufcaturers website) and connect the device to your computer, while newer phones support FOTA (Firmware Over The Air). For other devices, you may need a commercial relationship with the manufacturer in order to get the updates.

    Bear in mind that, if the device has an operator-specific firmware (and, most do), you might be able to update it only with an update from (or approved by) the operator.

    Also, you must factor-in your company's policy on supporting firmware versions.

    Graham.

  7. #7
    Registered User
    Join Date
    May 2007
    Posts
    91

    Re: fillRect() is not supporting

    Hello Graham,
    Frankly speaking I don't have a much more knowledge on firmware to ask further on it.
    At least with in your word
    Quote Originally Posted by Graham
    If you're seeing a kind of "chessboard" pattern, of two very similar colours, this is quite common on older Samsung devices, so it doesn't surprise me that it's still a problem.
    I have come to know what's the problem is.
    Thanks a Lot!

    Amit.

Similar Threads

  1. How to draw fillrect using QGraphicsRectItem
    By manjunath369 in forum Qt
    Replies: 2
    Last Post: 2012-05-31, 00:46
  2. Devices supporting RTMP?
    By Pakse in forum Streaming and Video
    Replies: 0
    Last Post: 2008-05-21, 10:25
  3. How to do a tansparent fillRect
    By amalshah73 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2008-04-10, 21:41
  4. createImage OR fillRect what is faster ?
    By waxattack in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2004-10-19, 07:39
  5. Possible fillRect limitation on earlier series 60's?
    By andrew_nevick in forum Mobile Java General
    Replies: 1
    Last Post: 2004-01-06, 19:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •