How convert a .txt file composed of 0 and 1 in a .bmp,jpg,png file ???
Hi to all friends of JAVA,
I tried to convert my .txt file like this (LIKE ONE IMAGE IN BLACK AND WITHE):
1111111.....
0000111.....
0011111.....
0111111.....
in a white and black image in .png format using:
RenderedImage image = JAI.create("fileload", "probe.txt");
RenderedOp op = JAI.create("filestore", image,"probe2.png" , "png");
but the error is:
Exception in thread "main" java.lang.RuntimeException: - Unable to render RenderedOp for this operation.
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:826)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:866)
at javax.media.jai.RenderedOp.getSampleModel(RenderedOp.java:2232)
at com.sun.media.jai.codecimpl.PNGCodec.canEncodeImage(PNGCodec.java:62)
at javax.media.jai.operator.FileStoreDescriptor.validateArguments(FileStoreDescriptor.java:176)
at javax.media.jai.JAI.createNS(JAI.java:1086)
at javax.media.jai.JAI.create(JAI.java:973)
at javax.media.jai.JAI.create(JAI.java:1621)
at Genim.<init>(Genim.java:158)
at Genim.main(Genim.java:301)
How can I convert this .txt file in a black and with image ????
THANK YOU in advance.
princo
I Solved my problem using the Jama Package. Thank you.
Similar Messages
-
My fonts are changing in iWed after I publish. I need step by step instructions on how to go to my third party server and clear out all of my files and reload my whole website, the solution I saw posted by another. Please someone help me on this. Urgent
If your fonts are changing when viewed on other computers - epecially those running windows - you need to look at using web-safe fonts...
http://www.iwebformusicians.com/iWeb/Fonts-Colors.html
Also make sure you clear your browser cache before viewing you published files. -
my mac will not copy more than one file at a time and gets locked up if the file is too large, my mac will not copy more than one file at a time and gets locked up if the file is too large
So now that you have repeated the same thing three times that doesn't make things any clearer at all.
You are copying files from where to where?
How are you attempting to copy files, software or click and drag?
Any other detail would be helpful.
Allan -
Problems with loading .bmp or .png files.
When I try to load a .bmp (or .png) file (with the example from the LabView-Homepage) I do not get the picture. There are only lines which (I guess when they are in the right order) will display the image correctly. Can you help me?
Thanks,
Armin Herzer
P.S.: I'm using LabView 6.0 for LinuxHello,
yesterday I came across the following: If you save the PGM-Image as a BMP with the following command
convert 00.pbm 00.bmp
you ran into trouble with Labview (because the image is saved in a packed format). If you save the image with this command
convert +compress 00.pbm 00.bmp
Labview displays the image correctly (because packing is now disabled). I suppose, that Labview (at least the Linux version) cannot handle compressed BMP's correctly. You can verify the same with the Gimp. If you enable RLE packing, the image is distorted. If you disable it, everything is o.k.
By the way, I wasn't able to display a PNG Image (but I tried not all variants of saving it). JPG is not of interest, because the image
s that must be processed are not allowed to be compressed with information loss (o.k., I can use 0% compression mode, but then I can use BMP).
Can you verify this behavior with Windows too?
The PGM-Image is created by a C-Programm written by me.
This program acts as a driver for a Leutron LFS-AT framegrabber board and should be included in Labview as a CIN (if I find a way to display the images :-)
Thanks in advance,
Armin -
How do I crop an image in photoshop and place it in an illustrator file without having a white backg
How do I crop and image in photoshop and place it in an illustrator file without having a white background ?
Could you post the image (or a lores version of it) on this Forum?
-
How to make the result showing one time and make the result to csv file?
My script having problem of showing out all the AD computer name result from Active Directory once when running it and storing the result to csv file. I am a newbie in AD and powershell.
This is the code:
$strADPathFile = "D:\Powershell for AD\ADPathList.txt"
$strErrLogFile = "D:\powershell for AD\errorADComputer.log"
$arrADPath = Get-Content -Path $strADPathFile
foreach ($strADPath in $arrADPath)
try
$objSearch = New-Object DirectoryServices.DirectorySearcher
$objSearch.Filter = '(objectCategory=computer)'
$objSearch.SearchRoot = $strADPath
$objSearch.SearchScope = "Subtree"
$objSearch.PageSize = 1000
$objResults = $objSearch.Findall()
write-host "Retrieving AD computer information in the domain $strDomain"
write-host "Number of AD Computer Name result: "$objResults.Count
foreach($objResult in $objResults){
$objComputer = $objResult.GetDirectoryEntry()
write-host $objComputer.dNSHostName
try
# InsertSQLTable $objComputer
catch
write-host $error[0]
$strError = $objComputer.dNSHostName + " " + $dateNow + $error[0]
Add-Content $strErrLogFile $strError
catch
write-host $error[0]
Export-Csv D:\PowerShellforAD\test2.csv
This is the error that I had get is that it will get the result for 2nd time again.
By the way, what is InputObject about? I had research some of it and still did not quite get it. Can anyone explain? ThanksHi,
in the final line you call Export-Csv. which is a great command at exporting information. However, for it to work it needs a path to export to (D:\PowerShellforAD\test2.csv in your case) and Information (InputObject) to export.
You do not give that command any Information, so it throws an error.
Cheers,
Fred
There's no place like 127.0.0.1 -
My file has insert command and i want to read that file line by line in sql
myfile.txt
insert into emp values(100,200,"sumedh",11);
insert into emp values(101,200,"amit",11);
insert into emp values(102,200,"sam",11);
insert into emp values(103,200,"ram",11);
insert into emp values(104,200,"stev",11);
I want to read this file line by line and enter this value in emp table.Why did you begin this thread in security.
just like
sqlplus <schema_owner>/<password>@<your_sid> @<path_to/myfile.txt> -
Scan on my PSC2210 all in ones does not become a pdf file (only jpg tif bmp or png files)
I try to scan a document and store it as a pdf file
on my windows XP I could scan a document as pdf and send it by email
now i use windows7 with my psc2210 and the only profile i can choose is BMP TIF JPG or PNG
is there an other possibility?
HenkHi - I'd recommend running the print diagnostic utility for starters. It should help isolate the problem and hopefully resolve it automatically. At the very least, it is a good starting point.
Hope that helps.
Say Thanks by clicking the Kudos thumbs up. Please mark the post that solves your problem as an Accepted Solution so other forum users can utilize the solution.
I am an HP employee. -
Windows 7 Home Premium, Dell XPS desktop. First problems with AI in a LONG time. Used to be able to go to the control panel for programs and "repair" the installation, now can only un-install.
This file is originally from a previous version of AI, opened it in CC2014 and edited, nothing extensive, just text updates, and after closing, it won't open again. And the program crashed. After a re-start of the computer, I could open a different file, but not the "problem" file. After re-doing the edits on another (even earlier) copy of the source file, the same thing happened. I can place the file in InDesign, and export to pdf, which views fine. I plan to try to edit the InD pdf in Illustrator, to see what happens.
Otherwise the computer seems to be fine, all other apps seem stable. So far.The file size is the same as the previous version. I placed the AI file into InD, made a pdf, and can open and edit that pdf in Illustrator. If I could get the "bad" file to open, I would save as to a new file, see if that would help, but since it won't open.... Just weird. I should have what I need now, so I don't plan to spend any more time on it. Thanks for thinking about it. I just hope I don't end up eventually having to uninstall/re-download and re-install Illustrator!
The only image is embedded, no link. I don't have any non-standard plug-ins. I will keep in mind about the preferences, but why only this 1 file having a problem with them? I did install some fonts for another job while also working on this; I will keep that in mind, too.
Thanks again. -
Pshop CC -- saving JPG & PNG file size bloat
Saving JPGs & PNGs from Photoshop CC is creating what I can only describe as a obscene file bloat. Just recently, what should have been a 7k jpg saved as a 1.1 mb jpg file. PNGs which should average roughly 100-150k are coming out at 1.3mb. If I use the "Save for Web", sometimes it gives me the proper sized images.
I have noticed this on 2 computers --- one a mac & one windows with completely different file sets. So it is not an issue of my OS, the original files or anything specific to one particular common item.
FYI -- Doing the same thing with pshop cs6, I get the proper file sizes.
I have included a sample image here. This image is a straight out "save" from pshop CC -- it is 1.1mb. However, when I saved the same image as a JPG in pshop cs6, it was 7k.
Is anyone else experiencing this issue?Haven't had a PNG or JPG go wacky here in that way so far...
I think the issue is revealed by looking in File - File Info in the Raw Data section. I don't know why, but there are a huge number of <rdf:li> XML elements showing up there with hex values in them. I don't know what that means, exactly, but I believe the accumulation of that metadata explains the size increase.
Do any of the terms you see in the raw metadata mean anything to you? Do you have 3rd party plug-ins that could be responsible for this?
-Noel -
How to call a SP with dynamic columns and output results into a .csv file via SSIS
hi Folks, I have a challenging question here. I've created a SP called dbo.ResultsWithDynamicColumns and take one parameter of CONVERT(DATE,GETDATE()), the uniqueness of this SP is that the result does not have fixed columns as it's based on sales from previous
days. For example, Previous day, customers have purchased 20 products but today , 30 products have been purchased.
Right now, on SSMS, I am able to execute this SP when supplying a parameter. What I want to achieve here is to automate this process and send the result as a .csv file and SFTP to a server.
SFTP part is kinda easy as I can call WinSCP with proper script to handle it. How to export the result of a dynamic SP to a .CSV file?
I've tried
EXEC xp_cmdshell ' BCP " EXEC xxxx.[dbo].[ResultsWithDynamicColumns ] @dateFrom = ''2014-01-21''" queryout "c:\path\xxxx.dat" -T -c'
SSMS gives the following error as Error = [Microsoft][SQL Server Native Client 10.0]BCP host-files must contain at least one column
any ideas?
thanks
Hui
--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --Hey Jakub, thanks and I did see the #temp table issue in our 2008R2. I finally figured it out in a different way... I manage to modify this dynamic SP to output results into
a physical table. This table will be dropped and recreated everytime when SP gets executed... After that, I used a SSIS pkg to output this table
to a file destination which is .csv.
The downside is that if this table structure ever gets changed, this SSIS pkg will fail or not fully reflecting the whole table. However, this won't happen often
and I can live with that at this moment.
Thanks
--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN -- -
How convert a report out put to pdf and sending it via an email
Hi all,
i have convert the sap list or report output to a pdf file then i have to send it via an email that is given in the selection screen. if anyone knows the solutions for this please make it soon. i will be very thankful.
Thanks & Regards,
Poornagenerate spool request of ur report output and execute the standard program RSTXPDFT4 with tht spool reuest.it will download it in PDF format on ur PC and to send it via mail as attachment ,just copy this below code -
*& Report ZGILL_SENDMAIL_PDF *
REPORT ZGILL_SENDMAIL_PDF .
INCLUDE ZGILL_INCMAIL. "SEE BELOW FOR INCLUDE PROGRAM CODE.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case DEFAULT '[email protected]'.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY DEFAULT 'C:\TEMP\SALARY_SLIP1.PDF'.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
*********************iNCLUDE pROGRAM********************************************
*& Include ZGILL_INCMAIL *
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
**********************INCLUDE END******************************** -
How to get the value from a JavaScript and send the same to Java file?
Hi.
How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
Thanks and regards,
Leslie VYes, I am trying with web application.
In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
How to send this 'message' with and to the 'request'?
Thanks for the help :-)
The actual JS code is:
function productdeselection()
var i=0;
var j=0;
var deselectedproduct = new Array(5);
var message = "Are you sure to delete Product ";
mvi=document.forms[0].MVI;
mei=document.forms[0].MEI;
lpi=document.forms[0].LPI;
if(null != mvi)
++i;
if(null != mei )
++i;
if(null != lpi)
++i;
if(null != mvi && mvi.checked)
deselectedproduct[++j]="MVI?";
if(null != mei && mei.checked)
deselectedproduct[++j]="GAP?";
if(null != lpi && lpi.checked)
deselectedproduct[++j]="LPI?";
if( 0!=j)
if(i!=j)
for (x=0; x<deselectedproduct.length; x++)
if(null != deselectedproduct[x])
message =message+ "-" +deselectedproduct[x];
alert(message);
else
//alert(" You cannot remove all products!");
return false;
return true;
} -
How can I get Indesign CS6 to open JPG/PNG files?
I recently purchased Indesign CS6. When I went to import a PNG, it failed to recognize it. I then tried a JPG to no avail. The exact error message reads as follows:
"Cannot open the file "photo.png". Adobe Indesign May not support the file format, a plug-in that supports the file format may be missing, or the file may be in another application."
How could the plug-ins be missing? Wouldn't these be installed with Indesign? Any advice as to how to proceed?.
Thanks in advance.You need to use the file>place command.
This is very, very basic and I'd respectfully suggest that you take a step back and learn a bit about the program. This link will get you a free one week trial of Lynda.com where you'll find some fabulous video training: http://bit.ly/RS0GXs
Bob -
How do I get a more modern look and feel for a compiled help file
I gather from reading various posts that there is no easy way
to generate a .chm file with a more modern look and feel (am I
right about this?). Are there no plug-ins available from Adobe that
will enable us to generate a help file that looks more modern?
I hesitate to move to flash help or something like that
because, of course, then the developers would have to hookup the
hundreds of dialog boxes we have in our product to the new files. I
also think that having one file is way easier to manage in terms of
getting updated help to the customers. What are online Help
developers generally delivering for apps where users are not
connected to the Internet except perhaps periodically while using
the software? I'm a writer (not a developer) so need soemthing that
is easy to implement :-)
Thanks for your help. It is much appreciated.To add to the advice already offered, you can apply a skin to
a CHM file which allows you to customise it. However as with most
things there are issues with this approach. You can read about this
by downloading Rick Stone's excellent
tips
'n tricks file. Just look in the index under "skins". Something
else you may want to look at is the beta of Adobe's
AIR.
Maybe you are looking for
-
It takes a long time to open up documents on my Imac. I get the multicolor circle for a long time. I have 27 In Mid 2010 3.2 ghz Intel core I3 with 16 gb memory.
-
Alerts should be thrown dynamically
Hi Experts, Is it possible to use the standard Alert Management of SAP Business One to display an alert on a particular form? The scenario below will clarify the requirement: Step 1) An end user adds an item to a marketing document (For eg. A/R Invoi
-
Regarding background processing of the session
Hi Gurus I have some records in my flat file. While i am doing uploading the file using tc, in foreground it is processing correctly and no issues. While in Background some of the records are not processing properly and in sm35 for those records I
-
Oracle Application Server 10.1.4 Installation Error
Hi, Ive been trying to install OAS and keep getting installation erros at the OID Configuration Assistant. Im on Sun Solaris 10 and meet all system requirements and have all the patches listed. When I check the oidca.log i get this: Entering Ldap Pos
-
Set by script the tag and/or the class of a paragraph style for HTML / EPUB export?
Is it possible to set by script the tag and/or the class of a paragraph style for HTML / EPUB export?