You Are Here:

Community: Developer Discussion Boards

#1 Old getPixels(), alpha-channel and emulators trouble - 2003-03-27, 10:09

Join Date: Mar 2003
Posts: 3
akdev
Offline
Registered User
I've tested the code (see below) on 'Concept s60 SDK 0.2b' and 'Symbian SDK 1.0' emulators. The code fragment draws 3 images on the white screen, but in 'concept' emulator they seem to be all different, and in 'symbian' one -- they're the same, but with fake alpha-blitting support. Unfortunately, I have no possibility to test in on the real s60 device (I'm targeting 7650)...

a) So, the question is -- what's wrong?
b) Which emulator is more close to the real device and what will be shown on 7650?
c) How to make it all work on 'concept' emulator?
d) Why the 'symbian' emulator is so slow comparing to 'concept' one? which of them gives the performance more close to 7650?

The 1st image is shown in a right way on 'concept' emulator (using 'brute force' loading and draw functions).
The 2nd image is non-transparent at all.
The 3rd one seems to contain wrong pixel data (getPixels() doen't work?)

---------------------- beginning code -----------------------------------
protected void paint (Graphics g)
{
int width = 0, height = 0, format = DirectGraphics.TYPE_USHORT_4444_ARGB;
short [] pixels = null;
Image img = null, mi = null;
try {
// (creating 1st)
img = Image.createImage("/test.png");
width = img.getWidth();
height = img.getHeight();
// (creating 2nd)
mi = DirectUtils.createImage(width, height, 0);
DirectGraphics dg = DirectUtils.getDirectGraphics(mi.getGraphics());
dg.drawImage(img, 0, 0, Graphics.TOP | Graphics.LEFT, 0);
// (creating 3rd)
pixels = new short [width * height + 1];
dg.getPixels(pixels, 0, width, 0, 0, width, height, format);
} catch (Exception e) {}

DirectGraphics fcdg = DirectUtils.getDirectGraphics(g);
g.setColor(0xffffffff);
g.fillRect(0, 0, getWidth(), getHeight());

// (drawing 1st)
fcdg.drawImage(img, 0, 10, Graphics.TOP | Graphics.LEFT, 0);
// (drawing 2nd)
fcdg.drawImage(mi, 30, 10, Graphics.TOP | Graphics.LEFT, 0);
// (drawing 3rd)
fcdg.drawPixels(pixels, true, 0, width, 60, 10, width, height, 0, format);
}
---------------------- the end -----------------------------------

Thank you in advance,
With respect,
akdev.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ