QImage Image conversion
Hi, I have a QImage I want to use an ImageView. What I did was converted into a bb::ImageData and then create an Image using this ImageData. The code is given below.
QImage imageQ; imageQ.load("app/native/assets/images/bg.png"); imageData = bb::ImageData::fromPixels(imageQ.bits(), bb::PixelFormat::RGBX, canvasWidth, canvasHeight, imageQ.bytesPerLine()); image = ImageView::create(). image(Image(imageData));
But the problem is that the image is reversed. The original image and the image converting QImage image run this public DropBox folder.
https://www.dropbox.com/sh/0c1tlan6a1jh0pv/AACDHIvqWTryXA0JjOo0_P-OA
Try to make a
imageQ = imageQ.rgbSwapped();
before the line fromPixels.
Tags: BlackBerry Developers
Similar Questions
-
EMF Tiff image conversion does not properly on Windows 7 PC
I have a c# application that monitors the Clipboard. When an EMF
comes, I extract the EMF of the Clipboard data and try to
Save offshore in a TIFF image. Everything works fine on a windows XP PC. However, when you do the conversion to grayscale, the converted image is not readable (blurry) on Window 7 PC (32-bit / 64-bit).I have using the standard GDI + for the conversion needs. What could be changed as the origin of the problem? Any help appreciated.
HelloYour question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for Visual c# in the MSDN forums. Please post your question in the Visual c# MSDN forum.Aziz Nadeem - Microsoft Support[If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]
-
Polygon color with RGB U64 images / Image conversion of RGB U64 in RGB U32
Hi guys,.
I want to use the color polygon feature, but I have an input RGB U64 image. The only supported is image RGB U32 type. Is it possible to convert the image to U64 U32 and use the color polygon feature? I know I'll lose accuracy, but what for the moment.
Otherwise, you know the functions of polygon that supports RGB U64 images as input?
Please let me know.
Thank you
ARE
IMAQ Cast Image VI Converts the current image type for the image type specified by Type of Image.
How Casting works: The VI shifts the value from the source to the range of 8-bit using the depth of specific bit of the source image. Then the VI defines each color component in the destination value for the corresponding component in the value of the source.
-
IMAQ JPEG image conversion problem string
Hi, I'm using the format JPEG decode VI to decode an image string I get a camera at Black fins. It works fine when I run VI himself, but when I use it as a subvi the program crashes. Anyone have advice?
This is a picture of my program
It's the way the file is returned to the camera
'I '. «#IMJxs0s1s2s3...» » Enter the JPEG compressed video image x = size of the frame in pixels:
1 = 80 x 64, 3 = 160 x 120, 5 = 320 x 240, 7 = 640 x 480, 9 = 1280 x 1024s0s1s2s3 = size of the image in bytes (s0 * 256 ^ 0 + s1 * 256 ^ 1 + s2 * 256 ^ 2 + s3 * 256 ^ 3).
... = full frame JPEGNote that sometimes the 'I' command returns nothing if the robot camera is busy, then the 'I' command should be called as many times as necessary until a framework is returned
I changed the format JPEG decode VI by changing the plans of red and blue color. I don't know if this caused the problem though.
Hello
This can be useful for you:
http://forums.NI.com/NI/board/message?board.ID=200&message.ID=21845#M21845
Andrey.
-
WLPG is not convert nikon raw (nef) images in of wmphoto. Any solution?
For those who do not know and do not want to look up:
WLPG is "Windows Live Photo Gallery"
"NEF" is the Nikon RAW image format. Nikon has even a codec download for it.
The wmphotos... * DECODING * 'Windows Media Photos?Have you tried the codec?
-
A texture image conversion complex in a simplified vector graphic
Hello
I have a complex of water chart, I'm trying to simplify and vectorize. I manipulated the image in Photoshop to bring out the contrast and tried pathing image then export paths to illustrator, but the size of the file was obviously great same situation bringing the TIFF in Illustrator and use the vectorization. Is there anyway between programs or both, I can simply and smooth the vector illustration to shall declare the size of the file and make it easier to manipulate, size, color, ect. ? I use the image as texture and it doesn't have to be complex, I would just flow and structure lines.
I've attached a screenshot of the TIFF Photoshop file I created off the coast of the original photo of the water and the vectorized version, that I have done, by using vectorization, in Illustrator. The vectorized version is a bit unstable and complex. I don't know you have a thing or the best way to do it.
Thank you very much.
TM
Color will be easier to handle after vectorization.
And if you do not want to lose details will not get fewer anchor points.
-
Clearscan indexable image conversion
Is there a relatively simple way to convert a PDF file saved as searchable image format Clearscan? I know that I can open pages in Photoschop, save them under objectives and then convert them to PDF using ClearScan but I'd like to find a less laborious way.
Barry Cooper
Yes, there is a direct way. You can run OCR on the file with the PDF output Style defined as Clear Scan. Follow the steps below:
1: Open the file in Acrobat.
2: call OCR on the file opened.
3: you will see a dialog box to specify the settings of the OCR.
4: change the settings to specify the output PDF as ClearScan Style.
5: run OCR on the file.
Your file will now be a ClearScan file.
Please note that although you can convert a searchable Image file to ClearScan file directly, but the reverse is not possible. So, if you want to convert file Clear Scan to searchable Image, you will need to go through the steps you mentioned.
-
Unique spot color grayscale image conversion
Hello.
I'm trying to convert a grayscale image in a single spot color image. The spot color is PMS425C, color gray, but as I'm only printing 2 colours I need to convert these images in one spot color.
Can someone please help?
Thank youHave you seen the monotonous separated to CMYK? If so, you can not make the PDF correctly and the place is being converted. It can still have CMYK channels, but they are empty and will not end plates. Check your output to PDF settings and check the ink Manager that the tasks are retained. In addition, there are more than one way to display preview of the output that can be confusing at first.
You export as PDF X / 1a and if your settings are correct, when you view in output preview (separations) in Acrobat, you should see the spot as a task.
Try to save your monotonous as .psd too many other formats will support the monotonous. If you view separations in ID, you will be able to see if your file supported by spot color.
-
Shockwave Flash object in Word2007 only Image conversion to PDF using Acrobat9 Pro
I put the Shockwave Flash object to integrate: True & video located on-site, then why isn't Acrobat 9 Pro conversion word to PDF video video.
I tried:
-using the "Acrobat" section on Ribbon Word to convert
-Save Word file to Acrobat using command "save under" password
-using Adobe printer in Word
-Open the file Word from Acrobat
Ive reskimmed just the word 'Advanced' and 'save' options & I see no additional checking to do.
Thanks for doing this,
SEM.Try the demo version of Pro Extended.
-
Create a QImage bb::cascades:Image
Hi, how can we create a QImage from bb::cascades:Image or bb::cascades:ImageData?
Thank you
Sorry to bring this element thead dead to life, but you can easily extract data from bb::ImageData using bb::utility:ImageConverter :
bb::ImageData imageData; // our source imageDataQByteArray encoded = bb::utility::ImageConverter::encode("image/bmp", imageData);QImage image; // destination QImage if (image.loadFromData(encoded, "BMP")) { // load QImage from encoded QByteArray as BMP streamQImage scaledImage = image.scaled(720, 720, Qt::KeepAspectRatio); // if we wish to scale source image scaledImage.save("sample.png", "PNG"); // if we wish to save scaled image}
-
.PS to GIF conversion - truncates the image
Hi all
I have an image file in .ps format. When I try to convert it to GIF or JPEG or PDF, I could see that the image is truncated on the right. But when I change the .ps file to be in landscape mode image conversion is correct.
But I want the image to be converted to Portrait without truncation of the image mode.
Can any help me to solve this problem in the .ps file.
Can do something chnaging the .ps file so that I can get a complete picture
Seen the content of postsript below:
--------------------
% ! PS
%% Version: 3.15
%% Presents: (atend)
%% Pages: (atend)
%% EndComments
Ident % ' @(#)lp:filter/postscript/postscript/dpost.ps 1.1 ".
%
Prologue to version 3.16% for troff files.
%/#copies store 1
1 def /aspectRatio
1 def /formsperpage
/ landscapes false def
Def lineWidth.3
1 def /magnification
/Margin 0 def
/orientation 0 def
def /Resolution 720
/xoffset 0 def
/YOFFSET 0 def/roundpage true def
/useclippath true def
/pagebbox [0 0 612 792] def/R/Times-Roman def
/I/Times-Italic def
Def/Times-Bold/b
Def/Times-BoldItalic /bi
Def /Helvetica/h
/Hi/Helvetica-Oblique def
Manual/Helvetica-Bold def
/HX/Helvetica-BoldOblique def
/Convoyeur def /CW
/ Co /convoyeur def
In/Courier-Oblique def
/BG/Courier-Bold def
/CX/Courier-BoldOblique def
/PA/Palatino-Roman def
/ER/Palatino Italic def
/PB/Palatino Bold def
/PX/Palatino-BoldItalic def
Def/Helvetica-Narrow/h
/Hi /Helvetica - Narrow - Oblique def
Manual/Helvetica-Narrow-Bold def
/HX/Helvetica-Narrow-BoldOblique def
/ Bookman-Light def /KR
/Ki/Bookman-LightItalic def
/ Bookman-half def /Ko
/KX/Bookman-def DemiItalic
/AR/AvantGarde-Book def
/AI/AvantGarde-BookOblique def
Def/AvantGarde-half/AB
/AX/AvantGarde-DemiOblique def
/Nr/NewCenturySchlbk-Roman def
Which/NewCenturySchlbk-Italic def
/NB/NewCenturySchlbk-Bold def
/NX/NewCenturySchlbk-BoldItalic def
Def/ZapfDingbats/ZD
Def/ZapfChancery-MediumItalic/Zi
/VR Varitimes #Roman def
/ VI Varitimes #Italic def
/VB /Varitimes def #Bold
/VX Varitimes #BoldItalic def
Def/s/s
/ Def /S1 S1
Def/Symbol/gr/inch {72 mul} bind def
/ min {copy 2 gt {exch} if pop} bind def/ Setup {}
counttomark 2 idiv {def} repeat poplandscape {/ orientation orientation 90 add def} if
/ 72 resolution div def scaling
LineWidth setlinewidth
1 setlinecappagedimensions
definition of Massilia overview
Rotate orientation neg
definition of width 2 neg 2 div height div
definition of x_offset inches decalage_y
2 div DUP. neg. margin definition
scale of magnification dup aspectratio mul
scale scale scale/ Symbol/s Sdefs FC
/ CF S1defs S1 times-Roman
0 0 moveto
} def{/pagedimensions}
useclippath /gotpagebbox userdict doesn't know not and {}
/pagebbox [pathbbox newpath clippath] def
roundpage currentdict known /roundpagebbox and {roundpagebbox} if
} If
pagebbox pop aload
4. 1 roll 4 1 roll 4 exch copy
landscape {4 2 roll} if
void /width exch def
void /height exch def
Add 2 div /xcenter exch def
Add 2 div /ycenter exch def
UserDict real /gotpagebbox put
} def{/PageSetup}
/ page exch def
currentdict /pagedict known currentdict known page and {}
Page load pagedict exch get cvx exec
} If
} def[/decodingdefs
{repeat it counttomark idiv 2 {y moveto show}}
{repeat it neg/y exch def counttomark 2 idiv {y moveto show}}
{repeat it neg moveto {index 2 sub stringwidth pop exch 0 32 4 div - 1 roll widthshow}}
{repeat it neg moveto {void 0.0 spacewidth 32 4 - 1 roll widthshow}}
{repeat it counttomark idiv 2 {y moveto show}}
{setfunnytext neg}
] def/setdecoding {/ t decodingdefs 3-1 roll get bind def} bind def
bind/w def {neg moveto show}
/m {neg dup/y exch def moveto} bind def
/ fact {/ lastpage where {pop lastpage} if} def/f {}
DUP / make exch findfont exch def
DUP /ptsize exch def scaling of div dup/Size exch scalefont setfont def
width of stripe ptsize mul scaling 10 setlinewidth div mul
/spacewidth () stringwidth pop def
} bind def{/changefont}
/FontHeight exch def
/fontslant exch def
[CurrentFont
1 0
FontHeight ptsize div fontslant sin fontslant cos div mul
FontHeight ptsize div
0 0
] makefont setfont
} bind def/SF {f} bind def
{/ cf}
DUP length 2 idiv
/Entries exch def
/chtab exch def
/NewFont exch deffindfont length 1 Add dict dup
/newdict exch def
ForAll {1 index /FID {newdict 3 1 roll could not} {pop pop} ifelse}newdict entries /Metrics dict set
newdict /Metrics get
Start
chtab pop aload
1 entries 1 {pop def}
newdict pop definefont NewFont
end
} bind def%
% Some tables used to adjust the points of reference and widths in some of the characters
% of the printer resident fonts. Try changing if the square roots are too high
% the lines describing the /radical and /radicalex,
%
% /radical [0-75 550 0]
% /radicalex [-50-75 500 0]
%/ [Sdefs
/bracketlefttp [220 500]
/bracketleftbt [220 500]
/bracketrighttp [-70 380]
/bracketrightbt [-70 380]
/braceleftbt [220 490]
/bracketrightex [220-125 500 0]
/ radical [0 0 550 0]
Newsprint %------(br is too low to compensate for
statusdict /product get {eq (NeWS server)
/radicalex [-50 100 500 0]
/parenleftex [-20 100 0 0]} {
/radicalex [0-50 500 0]
/parenleftex [-20-170 0 0]
} ifelse
/ integral [100-50 500 0]
/Infinity [-10 75 730 0]
] def/ [S1defs
/ underline [0 0 80 500]
/endash [7 90 650 0]
] def
%% EndProlog
%% BeginSetup
brand
%% FormsPerPage: 2
/formsperpage 2 def
Setup
2 setdecoding
% EndSetup
%% Page: 1 of 1
Save
brand
1 pagesetup
14 I have f
(Sp) 1220 882 w
11 S f
(-) 1378 924 w
14 I have f
(A) 1439 882 w
14 S f
(\354)1547 799 w)
(\356)1547 939 w)
14 I have f
W (UtranCell) 1616 882
14 S f
(\374)2208 799 w)
(\376)2208 939 w)
(=) 2277 882 w
14 R f
(100) 882 2354 w
14 S f
(\351)2587 799 w)
(\353)2587 939 w)
14 R f
(%) 2657 882 w
14 S f
(\371)2796 799 w)
(\373)2796 939 w)
(\264)2849 882 w)
14 I have f
w 1387 1467 (pmTotNoRrcConnectReqCs)
14 S f
(\354)2967 1384 w)
(\356)2967 1524 w)
14 I have f
W 3036 1467 (UtranCell)
14 S f
(\374)3628 1384 w)
(\376)3628 1524 w)
14 I have f
w (pmTotNoRrcConnectReqCsSucc) 1255 1146
14 S f
(\354)3099 1063 w)
(\356)3099 1203 w)
14 I have f
W (UtranCell) 3168 1146
14 S f
(\374)3760 1063 w)
(\376)3760 1203 w)
14 f S1
t 1 2616 1 1234 1257 (_ _)
14 S f
(\264)3864 1299 w)
14 I have f
w 1255 2052 (pmNoNormalNasSignReleaseCs)
14 S f
(w \354)3094 1969
(\356)3094 2109 w)
14 I have f
W 3163 2052 (UtranCell)
14 S f
(w \374)3755 1969
(\376)3755 2109 w)
(+) 3824 2052 w
14 I have f
w 3901 2052 (pmNoSystemNasSignReleaseCs)
14 S f
(w \354)5700 1969
(\356)5700 2109 w)
14 I have f
W 5769 2052 (UtranCell)
14 S f
(w \374)6361 1969
(\376)6361 2109 w)
14 I have f
w (pmNoNormalNasSignReleaseCs) 2558 1731
14 S f
(\354)4397 1648 w)
(\356)4397 1788 w)
14 I have f
W (UtranCell) 4466 1731
14 S f
(\374)5058 1648 w)
(\376)5058 1788 w)
14 f S1
(_ __________________________________________________________________________)1 5217 1 1234 1842 t
14 S f
(\264)6465 1884 w)
14 I have f
w (pmNoRabEstablishAttemptSpeech) 1255 2637
14 S f
(2554 \354)3191 w)
(2694 \356)3191 w)
14 I have f
W (UtranCell) 3260 2637
14 S f
(2554 \374)3852 w)
(2694 \376)3852 w)
14 I have f
w (pmNoRabEstablishSuccessSpeech) 1255 2316
14 S f
(\354)3192 2233 w)
(\356)3192 2373 w)
14 I have f
W (UtranCell) 3261 2316
14 S f
(\374)3853 2233 w)
(\376)3853 2373 w)
14 f S1
t 1 2709 1 1234 2427 (_ _)
cleartomark
showPage
restoration
%% EndPage: 1 1
%% Trailer
fact
% Present: Times-italic Times-Roman symbol
%% Pages: 1--------------------------
Thanks in advance.
Kind regards
Jawahar
Your file PS does not contain the parameters of size or page orientation, so the PostScript interpreter you use
simply defines the configured default page size.
As the file defines something as a page covering (the name pagebbox is used), take the fiven values it
to build a State of page size. For example insert
< agesize="" [792="" 612]="">> setpagedevice
right after the comment lines (lines starting with two percent signs). Forcing your PS interpreter
(condition he speaks at least the language level 2, that I take in silence) to make the formula for a
Letter size page orientation is landscape.
If you really want a portrait orientyation, you need to swap two numbers in the
Statement above and enter the code to scale down the formula.
Helge
-
I'm trying to make a 1-bit image and I tried several ways to do but got nowhere with it. I hope someone will see the mistakes I make and show me how to solve this problem, I joined the program I was working, the image I used is also attached it may be I don't know.
Hey alang.
by converting into PNG I don't mean not simply to rename the file...
Your BMP is a 24-bit image, so you should check the output 24-bit image conversion routine. Then you simply check a single color component (as it is a grayscale image) for your level of comparison:
-
Hi all
Is it possible to convert QByteArray QImage?
Answer please!
See you soon!
use the registration method.
example of http://qt-project.org/doc/qt-4.8/qimage.html#save-2
QImage image; QByteArray ba; QBuffer buffer(&ba); buffer.open(QIODevice::WriteOnly); image.save(&buffer, "PNG"); // writes image into ba in PNG format
-
Saving image with data in QVariant
JPEG image is converted to QVariant (with bb::cascades:Image) by using the following code
m_image is bb::cascades:Image
m_image = bb::cascades:Image (imageData);
Converted to QVariant using QVariant::fromValue (m_image)
The image is displayed in qml. (I can't save the file immediately after uploading there will be a lot of pictures and I have to select and save.) When the image is displayed his QVariant...
I would like to save this image, who subsequently to use as Photo of Contact...
I saw the code example
imageData1 is QByteArray
Image image = QImage::fromData (imageData1, "BMP");
QFile outFile("shared/photos/temp1.bmp"); change the path to your file
outFile.open (QIODevice::WriteOnly);
image. Save (& outFile, "JPEG");I tried to convert the QVariant to QByteArray using QVariant.toByteArray (). but it did not work.
Any help will be really appreciated...
The problem is solved by standing around ImageData object of data instead of the Image object. By using the following code...
Demonstration of QByteArray = ImageConverter::encode ("image/jpeg", myImageData);
QImage image = QImage::fromData (demonstration, "JPEG");
QString imgPath = "shared/photos/"+myImageName+".jpg";If (!) QFile::exists(imgPath))))
{
QFile outFile (imgPath);outFile.open (QIODevice::WriteOnly);
image. Save (& outFile, "JPEG");
} -
Loading an image works on Z10, but not on the Q5
I use FilePicker to load an image from the library by using the following code
Container { ... ImageView { id: imgView verticalAlignment: VerticalAlignment.Center horizontalAlignment: HorizontalAlignment.Center scalingMethod: ScalingMethod.AspectFit maxHeight: 250 minHeight: 100 bottomMargin: 30.0 } } Container { verticalAlignment: VerticalAlignment.Bottom horizontalAlignment: HorizontalAlignment.Fill bottomPadding: 30.0 leftPadding: 30 rightPadding: 30 Button { id: btnSelectImg topPadding: 25 horizontalAlignment: HorizontalAlignment.Fill text: qsTr("Select Image") + Retranslate.onLocaleOrLanguageChanged onClicked: { console.log("FilePicker") picker.open() } attachedObjects: [ FilePicker { //image picker id: picker property string selectedFile type: FileType.Picture title: qsTr("Select Image") + Retranslate.onLocaleOrLanguageChanged onFileSelected: { imgView.imageSource = "file://" + selectedFiles[0]; } } ] } } }
Copy the following code to display the image correctly on Z10, but not on Q5 however both running the same version.
No idea what could be the problem?
It turns out that the problem is exactly as described by dbigham, ImageView can handle images up to a certain size depedning on the device.
I added a C++ code to resize the image before feeding it to QML
QML code:
ImageView { id: imgView attachedObjects: [ ImageTracker { id: imgViewTracker onStateChanged: { if (state == ResourceState.Loaded) { imgView.image = imgViewTracker.image console.log("Shared image loaded correctly!") } else if (state == ResourceState.ErrorMemory) { console.log("Shared image load: Error Memory!") } else if (state == ResourceState.ErrorInvalidFormat || state == ResourceState.ErrorNotFound) { console.log("Shared image load: " + state + "!") } } }, FilePicker { //image picker id: picker property string selectedFile type: FileType.Picture title: qsTr("Select Image") + Retranslate.onLocaleOrLanguageChanged onFileSelected: { _app.loadImage(selectedFiles[0],300,200) imgViewTracker.image = _app.image; } } ] }
C++ code:
void ApplicationUI::loadImage(QString strImageFileName, int width, int height) { QImage image; image.load(strImageFileName); image = image.scaled(width, height, Qt::KeepAspectRatioByExpanding); QImage swappedImage = image.rgbSwapped(); if(swappedImage.format() != QImage::Format_RGB32) { swappedImage = swappedImage.convertToFormat(QImage::Format_RGB32); } const bb::ImageData imageData = bb::ImageData::fromPixels(swappedImage.bits(), bb::PixelFormat::RGBX, swappedImage.width(), swappedImage.height(), swappedImage.bytesPerLine()); m_image = bb::cascades::Image(imageData); emit imageChanged(); } QVariant ApplicationUI::image() const { return QVariant::fromValue(m_image); }
C++ header:
class ApplicationUI : public QObject { ... Q_PROPERTY(QVariant image READ image NOTIFY imageChanged) public: ... Q_INVOKABLE void loadImage(QString strImageFileName, int width, int height); signals: ... void imageChanged(); private: ... QVariant image() const; bb::cascades::Image m_image;
Maybe you are looking for
-
How can I keep TB take too much space on my hard drive?
My TB 'All messages' folder using 24 GB (against only 4 GB in Gmail). I can't find any NSTMP files to remove under imap.googlemail.com or anywhere else. Under imap.google.com , there are only two files-[Gmail] .sbd and INBOX.std. The last folder is e
-
With this active Add On, the system seems to be cycling in and out of repeated calls to "verify" something, I guess, adding an irritating delay for surfing the internet. I've seen no detrimental effect to the deactivation of this Add On to this day.
-
I would like to change the font in the mail. How ca7I this?
-
Hello, Hello, What is the best way to make a double slider to select a range of values? By that I mean you have a cursor with MIN / values of MAX and two sliders, a LOW and high. One is of course always lower than the other (strict or not). I tried a
-
Lack of STARTUP programs links &#62; all programs
HelloI ' #m at a loss about what happened, a single moment all my programs are visible by clicking on the START button and then the All PROGRAMS folder, even my Microsoft Office 2013 has disappeared, in the list that you see in the inserted picture,